Method and an apparatus for stream conversion a method and an apparatus for data recording and data recording medium

ABSTRACT

In a recording medium storing MPEG stream, flag information (encode_condition) indicating that the stream is recorded in a format enabling easily the first stream (MPEG transport stream) to be converted into the second stream (MPEG program stream) is provided. Such a flag information is included in Tip packet which is a control packet, in the medium. Thus it can easily determine whether the data is recorded in this format without analysis of data stored in the recording medium.

TECHNICAL FIELD

[0001] The present invention relates to a readable, recordable datarecording medium for recording multimedia data including moving picture(video) data, still picture data, audio data, and formatting data fordata broadcasting. This invention also relates to a system and methodfor recording data to this data recording medium.

BACKGROUND ART

[0002] Where 4.7 GB was until recently the maximum storage capacity forrewritable optical discs, phase-change DVD-RAM media with a storagecapacity of tens of gigabytes are now available. DVD-RAM media arealready used as a storage medium in the computer industry, and areexpected to soon be used as a recording and playback medium in theaudio-video (AV) field as a result of the development of economicalencoders and decoders implementing the MPEG-1 and MPEG-2 digital AV datacoding standards.

[0003] Digital broadcasting has already started in Japan, making itpossible to multiplex video, audio, and data for multiple programs to anMPEG transport stream (MPEG-TS below). Digital broadcast recorders usinghard disk drives or DVD drives are also available.

[0004] These next-generation digital broadcast recorders often recordthe broadcast content as it was broadcast without converting theMPEG-TS. So that the recorder does not need to be able to internallyprocess both the MPEG-TS and MPEG program stream (MPEG-PS below), theserecorders are expected to encode even external analog AV content fromline input terminals (i.e., user content) to the MPEG-TS for recording.

[0005] The current DVD theoretical standards (such as DVD-Video,DVD-Audio, DVD Video Recording, and DVD Stream Recording standards) usethe MPEG-PS for AV stream recording. This means that to convert contentrecorded using the MPEG-TS, such as in the above digital broadcastrecorder, to the DVD-Video format, for example, the MPEG-TS must beconverted to an MPEG-PS.

[0006] Converting an MPEG-TS multiplexed content stream to an MPEG-PS,however, requires complex computations for decoder buffer management.The conversion process therefore takes longer, requires re-encoding theelementary stream, may degrade the image and sound quality, and is thusgenerally difficult to accomplish.

DISCLOSURE OF INVENTION

[0007] The present invention is therefore directed to solving theseproblems, and an object of this invention is to provide a data recordingmedium for recording data to an MPEG transport stream whereby contentrecorded in an MPEG-TS format can be converted quickly and simply to anMPEG-PS format. A further object is to provide a system and a method forrecording, converting, and playing back data using this data recordingmedium.

[0008] A stream conversion apparatus according to the invention isprovided for converting a first stream of multiplexed video data andaudio data recorded to a recording medium to a second stream, the firststream having a structure for storing data segmented in first blocks,the second stream having a structure for storing data segmented insecond blocks, the maximum data size of the first and second blocksbeing different, wherein the first stream format is a constrained formatfor conversion to the second stream.

[0009] With the constrained format, a specific number of consecutivefirst blocks in the first stream are managed as a unit (MultiplexingUnit), the specific number is set so that a total amount of data storedin the unit does not exceed an amount of data stored to one secondblock, and all data stored in the same unit are the same video stream orthe same audio stream. An input start time to a system decoder of adestination second block to which the stream is converted is the same asthe later one of a first candidate time and a second candidate time. Thefirst candidate time is the input start time to the system decoder of asource unit being converted. The second candidate time is the time atwhich input to the system decoder of the second block immediately beforethe destination second block to which the source unit is converted ends.

[0010] The recording medium also records a flag indicating whether therecorded first stream is recorded in the constrained format.

[0011] The stream conversion system comprises: a reading sectionoperable to read the first stream from the recording medium; aconversion section operable to convert the read first stream to a secondstream; and a recording section operable to record the converted secondstream to the recording medium. The conversion section references theflag to determine if the format of the first stream is the constrainedformat. When the first stream determined to be recorded using theconstrained format, it converts, by unit, the first blocks composing theunit to one second block without changing the multiplexing order of thefirst blocks, and selects the later one of the first and secondcandidate times as the time stamp information of the converted secondblock to set the decoder input start time of the second block.

[0012] A plurality of consecutive units in the first stream may bemanaged as a capsule in which a control block is inserted. The firstblock located at the head of the unit may include first time stampinformation (ATS[i]) indicating an input start time to a system decoderbased on a first reference value. The control block may contain thefirst time stamp information (ATS_tip) based on the first referencevalue, and second time stamp information (PCR_tip) based on a secondreference value different from the first reference value. The secondtime stamp information (calculated_PCR[i]) of the first block located atthe head of each unit and input start time (SCR[i]) to the systemdecoder of each second block included in the second stream convertedfrom the first stream can be obtained from the following formulas,

SCR[1]=calculated_(—) PCR[1]

SCR[i]=max(SCR[i−1]+T, calculated_(—) PCR[i])

calculated_(—) PCR[i]=PCR_tip+(ATS[i]−ATS_tip+C)

[0013] where i is an integer which is 2 or more, T is the minimumtransfer time of a second block, and C is a correction factor foroverflow of ATS[i].

[0014] When determining, by referencing the flag, that the format of thefirst stream is not the constrained format, the conversion section mayre-encode the first stream to convert the first stream to the secondstream.

[0015] A recording apparatus according to the invention is provided formultiplexing video information and audio information to record theinformation to a recording medium in a format enabling conversion from afirst stream to a second stream.

[0016] The first stream has a structure for storing data segmented infirst blocks. The second stream has a structure for storing datasegmented in second blocks. The maximum data size of the first andsecond blocks is different.

[0017] With the format, a specific number of consecutive first blocks inthe first stream are managed as a unit (Multiplexing Unit), the specificnumber is set so that a total amount of data stored in the unit does notexceed an amount of data stored to one second block, and all data storedin the same unit are the same video stream or the same audio stream.

[0018] A plurality of consecutive units including video data by decodeunit in the first stream are managed as a capsule in which a controlblock is inserted, the control block stores a flag indicating if therecording format of the first stream is the constrained format.

[0019] An input start time to a system decoder of a destination secondblock to which the stream is converted is the same as the later one of afirst candidate time and a second candidate time. The first candidatetime is the input start time to the system decoder of a source unitbeing converted, and the second candidate time is the time at whichinput to the system decoder of the second block immediately before thedestination second block to which the source unit is converted ends.

[0020] The first stream is converted to the second stream by converting,by unit, the first blocks composing the unit to one second block withoutchanging the multiplexing order of the first blocks, and selecting thelater one of the first and second candidate times as the time stampinformation of the converted second block to set the decoder input starttime of the second block.

[0021] The recording apparatus comprises: an encoding section operableto encode the video information and audio information to be recorded tothe first stream according to the format; a recording section operableto record the encoded first stream to the recording medium; and acontrol section operable to control the encoding section and recordingsection. The control section anticipates the second stream convertedfrom the encoded first stream when encoding the first stream, and thenencodes the first stream so that at least one of a buffer underflow andbuffer overflow occurs in neither the encoded first stream or theanticipated second stream.

[0022] A recording medium according to the invention is provided forrecording video data and audio data multiplexed in a format enablingconverting a first stream to a second stream. The first stream has astructure for storing data segmented in first blocks, and the secondstream has a structure for storing data segmented in second blocks. Themaximum data size of the first and second blocks are different.

[0023] With the format, a specific number of consecutive first blocks inthe first stream are managed as a unit (Multiplexing Unit), the specificnumber is set so that a total amount of data stored in the unit does notexceed an amount of data stored to one second block, and all data storedin the same unit are the same video stream or the same audio stream. Aplurality of consecutive units including video data by decode unit inthe first stream are managed as a capsule in which a control block isinserted, the control block stores a flag indicating if the recordingformat of the first stream is the constrained format.

[0024] An input start time to a system decoder of a destination secondblock to which the stream is converted is the same as the later one of afirst candidate time and a second candidate time. The first candidatetime is the input start time to a system decoder of a source unit beingconverted, and the second candidate time is the time at which input tothe system decoder of the second block immediately before thedestination second block to which the source unit is converted ends.

[0025] The first stream is converted to the second stream by converting,by unit, the first blocks composing the unit to one second block withoutchanging the multiplexing order of the first blocks, and selecting thelater one of the first and second candidate times as the time stampinformation of the converted second block to set the decoder input starttime of the second block.

[0026] A stream conversion method according to the invention is providedfor converting a first stream of multiplexed video data and audio datarecorded to a recording medium to a second stream. The first stream hasa structure for storing data segmented in first blocks, and the secondstream has a structure for storing data segmented in second blocks. Themaximum data size of the first and second blocks are different.

[0027] The first stream format is a constrained format for conversion tothe second stream.

[0028] With the constrained format, a specific number of consecutivefirst blocks in the first stream are managed as a unit (MultiplexingUnit), the specific number is set so that a total amount of data storedin the multiplexing unit does not exceed an amount of data stored to onesecond block, and all data stored in the same unit are the same videostream or the same audio stream. An input start time to a system decoderof a destination second block to which the stream is converted is thesame as the later one of a first candidate time and a second candidatetime. The first candidate time is the input start time to the systemdecoder of a source unit being converted. The second candidate time isthe time at which input to the system decoder of the second blockimmediately before the destination second block to which the source unitis converted ends,

[0029] The recording medium also records a flag indicating whether therecorded first stream is recorded in the constrained format.

[0030] The stream conversion method includes referencing the flag todetermine the format of the first stream in order to convert the firststream to the second stream, when the format of the first stream is theconstrained format, converting, by unit, the first blocks composing theunit to one second block without changing the multiplexing order of thefirst blocks, and selecting the later one of the first and secondcandidate times as the time stamp information of the converted secondblock to set the decoder input start time of the second block.

[0031] A recording method according to the invention is provided formultiplexing video information and audio information to record theinformation to a recording medium in a format enabling conversion from afirst stream to a second stream. The first stream has a structure forstoring data segmented in first blocks. The second stream has astructure for storing data segmented in second blocks. The maximum datasize of the first and second blocks are different.

[0032] With the format, a specific number of consecutive first blocks inthe first stream are managed as a unit (Multiplexing Unit), the specificnumber is set so that a total amount of data stored in the unit does notexceed an amount of data stored to one second block, and all data storedin the same unit are the same video stream or the same audio stream. Aplurality of consecutive units including video data by decode unit inthe first stream are managed as a capsule in which a control block isinserted, the control block stores a flag indicating if the recordingformat of the first stream is the constrained format.

[0033] An input start time to a system decoder of a destination secondblock to which the stream is converted is the same as the later one of afirst candidate time and a second candidate time. The first candidatetime is the input start time to the system decoder of the source unitbeing converted, and the second candidate time is the time at whichinput to the system decoder of the second block immediately before thedestination second block to which the source unit is converted ends.

[0034] The first stream is converted to the second stream by converting,by unit, the first blocks composing the unit to one second block withoutchanging the multiplexing order of the first blocks, and selecting thelater one of the first and second candidate times as the time stampinformation of the converted second block to set the decoder input starttime of the second block.

[0035] The recording method comprises, when encoding the first stream,anticipating the second stream converted from the encoded first stream,and encoding the first stream so that at least one of buffer underflowor buffer overflow occurs in neither the encoded first stream or theanticipated second stream.

[0036] A program according to the present invention enables a computerto execute the stream conversion method or recording method of theinvention.

Effects of the Invention

[0037] According to the invention, in a recording medium storing MPEGstream, flag information indicating that the stream is recorded in aformat enabling easily the first stream (for example, MPEG transportstream) to be converted into the second stream (for example,MPEG programstream) is provided. Such a flag information is included in apredetermined control packet. Thus it can easily determine whether thedata is recorded in this format without analysis of data stored in therecording medium, achieving efficient format determination process.

BRIEF DESCRIPTION OF DRAWINGS

[0038]FIG. 1 is a schematic diagram of an exemplary interface between aDVD recording apparatus and other components used in conjunctiontherewith;

[0039]FIG. 2 is a block diagram of the drive of a DVD recorder;

[0040]FIG. 3A is a graph illustrating the correlation between dataaccumulation in a track buffer, and FIG. 3B is a contiguous area ondisc;

[0041]FIG. 4 is a block diagram of a DVD recorder having a semiconductormemory card and hard disk drive;

[0042]FIG. 5A shows physical structure of a typical disc, and FIG. 5Bshows a format of a typical disc;

[0043]FIGS. 6A and 6B show logical data spaces of the disc;

[0044]FIG. 7A shows the disc directory, FIG. 7B shows the filestructure;

[0045]FIG. 8 shows the structure of a video object;

[0046]FIG. 9 shows the MPEG system stream;

[0047]FIGS. 10A to 10C show the MPEG transport stream (MPEG-TS);

[0048]FIGS. 11A to 11C show the MPEG program stream (MPEG_PS);

[0049]FIGS. 12A to 12D show a TS packet;

[0050]FIGS. 13A, 13B, 13C1 and 13C2 show examples of PAT table and PMAPtable;

[0051]FIGS. 14A to 14C show the arrangement of video objects on disc;

[0052]FIGS. 15A and 15B show the data structure of video managementinformation;

[0053]FIGS. 16A and 16B show the data structure of video managementinformation;

[0054]FIG. 17 shows the relationship between an object, objectinformation, and PGC information in the video management information;

[0055]FIG. 18 is a block diagram showing the functional configuration ofa playback (reproducing) apparatus;

[0056]FIG. 19 is a block diagram showing the functional configuration ofa recording apparatus;

[0057]FIG. 20 describes the correlation between an MPEG-TS encoded foreasy conversion to an MPEG-PS, and the MPEG-PS after conversion;

[0058]FIG. 21 is a block diagram of the encoder of a data recordingapparatus according to the present invention;

[0059]FIG. 22 shows differences in processes for converting from aself-encoded MPEG-TS to DVD formats due to differences in systemencoding;

[0060]FIG. 23 shows the data structure of Tip packet;

[0061]FIG. 24 shows the data structure of Data_ID;

[0062]FIG. 25 shows the data structure of display_and_copy_info;

[0063]FIG. 26 shows the data structure of encode_info;

[0064]FIG. 27 shows the data structure of PES_info;

[0065]FIG. 28 shows the data structure of MakersPrivateData;

[0066]FIG. 29A describes PID of Tip packet, and FIG. 29B describesstream_type of Tip packet;

[0067]FIG. 30 shows the field values of the PES packet header in aConstrained SESF stream;

[0068]FIG. 31 shows PES_extension_flag and PES_header_data_length in aConstrained SESF stream;

[0069]FIG. 32 shows an example of an MPEG-TS self-encoded such that itdoes not conform to the T_STD model;

[0070]FIGS. 33A and 33B show an example of an MPEG_PS converted from anMPEG-TS such that the MPEG_PS does not conform to the P_STD model;

[0071]FIG. 34 shows SCR calculation;

[0072]FIG. 35 shows the elementary stream attributes of a ConstrainedSESF when encode_condition=“11b”;

[0073]FIG. 36 shows the elementary stream attributes of a ConstrainedSESF when encode_condition=“01b”;

[0074]FIG. 37 shows the standard stream structure in DVD Video;

[0075]FIG. 38 shows part of the data structure of the pack header of apack in MPEG-2 program stream;

[0076]FIG. 39 shows part of the data structure of the packet header inan MPEG-2 program stream;

[0077]FIGS. 40A and 40B show conversion from a Constrained SESF to anMPEG_PS for a video pack;

[0078]FIGS. 41A and 41B show conversion from a Constrained SESF to anMPEG_PS for an audio pack;

[0079]FIG. 42 is a table of audio bit rates allowed by the ConstrainedSESF, and the maximum payload length stored to one audio PES packet forAC-3 and MPEG-1 Audio at the corresponding bit rates;

[0080]FIG. 43 is a flow chart of the overall TS2PS conversion process;

[0081]FIG. 44 is a flow chart of the initialization process in the TS2PSconversion process;

[0082]FIG. 45 is a flow chart of the capsule unit process in the TS2PSconversion process;

[0083]FIG. 46 is a flow chart of the pack unit process;

[0084]FIG. 47 is a flow chart of the SCR calculation process;

[0085]FIG. 48 is a flow chart of the pack header process;

[0086]FIG. 49 is a flow chart of the packet header process;

[0087]FIG. 50 is a flow chart of the stream ID process;

[0088]FIG. 51 is a flow chart of the start-of-PES packet process;

[0089]FIG. 52 is a flow chart of the non-start-of-PES packet process;

[0090]FIG. 53 is a flow chart of the payload process;

[0091]FIG. 54 is a flow chart of the padding packet process;

[0092]FIG. 55 shows the Constrained SESF stream format;

[0093]FIG. 56 shows the data structure of PES packet on an MPEGstandard;

[0094]FIG. 57A describes conversion from an unconstrained MPEG-TS to anMPEG-PS, and FIG. 57B describes conversion from a constrained MPEG-TS toan MPEG-PS;

[0095]FIG. 58A describes buffer management of the MPEG-TS andanticipated MPEG-PS when the bit rate is the same in the MPEG-TS beingconverted and the resulting MPEG-PS (when buffer underflow occurs);

[0096]FIG. 58B describes buffer management of the MPEG-TS andanticipated MPEG-PS when the bit rate is the same in the MPEG-TS beingconverted and the resulting MPEG-PS (when buffer underflow does notoccur);

[0097]FIG. 59A describes buffer management of the MPEG-TS andanticipated MPEG-PS when the bit rate of the MPEG-TS being converted ishigher than the bit rate of the resulting MPEG-PS (when a bufferunderflow occurs only with the MPEG-PS);

[0098]FIG. 59B describes buffer management of the MPEG-TS andanticipated MPEG-PS when the bit rate of the MPEG-TS being converted ishigher than the bit rate of the resulting MPEG-PS (when a bufferunderflow does not occur);

[0099]FIG. 60A describes determining the time stamp information (SCR)set in the packs of the converted MPEG-PS (when the MPEG-TS and MPEG-PSwith the same bit rate);

[0100]FIG. 60B describes determining the time stamp information (SCR)set in the packs of the converted MPEG-PS (when the MPEG-TS transferrate is higher than the MPEG-PS transfer rate); and

[0101]FIG. 61 shows the correlation between the relative transfer timeATS added to each TS packet, and the transfer time calculated_PCR[n] ofthe first TS packet in the multiplexing unit.

BEST MODE FOR CARRYING OUT THE INVENTION

[0102] A DVD disc, DVD recorder, and DVD player are described in thefollowing sequence below with reference to the accompanying figures asspecific embodiments of a data recording medium, recording system, andplayback system according to the present invention.

[0103] The essential points of the present invention are described insection 8, summary of the invention, and section 9, detailed descriptionof the embodiments. It will be noted, however, that all of the followingare embodiments of the invention though they vary in their relationshipto the invention.

[0104] 1. Summary of a DVD recorder system

[0105] 2. Functional summary of a DVD recorder

[0106] 3. Summary of a DVD disc

[0107] 4. Summary of reproduced AV data

[0108] 5. Summary of AV data management information and playback control

[0109] 6. Basic operation of the playback function

[0110] 7. Basic operation of the recording function

[0111] 8. Summary of the invention

[0112] 9. Detailed description of the embodiments

[0113] Note that for simplicity “TS2PS conversion” as used below meansconverting the MPEG transport stream (MPEG-TS) to an MPEG program stream(MPEG-PS), and “DVD format” refers both the format of the DVD-Videostandard and the format of the DVD-Video Recording standard, both ofwhich are MPEG-PS formats.

1. Summary of a DVD Recorder System

[0114]FIG. 1 is a schematic diagram used to describe a DVD recorder andthe interface between a DVD recorder and other equipment.

[0115] As shown in FIG. 1, a DVD optical disc is loaded into the DVDrecorder for recording and reproducing video data. The DVD recorder istypically operated with a remote control.

[0116] Video data can be input to the DVD recorder using analog signals,such as from analog broadcasts, or digital signals, such as from digitalbroadcasts. Analog broadcasts are generally received by the receiverbuilt in to a television, for example, demodulated, and input the DVDrecorder as an NTSC or other type of analog video signal. Digitalbroadcasts are usually received and demodulated to a digital signal by aset-top box (STB) receiver and input to the DVD recorder for recording.

[0117] Video data recorded to a DVD is similarly reproduced andexternally output by the DVD recorder. As with the input, the video canbe output as an analog signal or digital signal. Analog signal outputcan be output directly to the television while digital signal output ispassed through the STB for conversion to an analog signal before inputto the television for viewing.

[0118] In addition to DVD recorders, DVD camcorders and personalcomputers can also be used to record and play back video data to andfrom DVDs. DVDs containing video data recorded by a device other than aDVD recorder can also be loaded into the DVD recorder for playback.

[0119] Audio data is also normally recorded with the video data in bothanalog and digital broadcasts, and this audio data can be likewiserecorded and reproduced by the DVD recorder.

[0120] Furthermore, the video data is generally moving picture data(such as a movie), but may also be or include still pictures. Thesestill pictures can be recorded using the still imaging function of a DVDcamcorder, for example.

[0121] Various digital interfaces can be used to connect the STB and DVDrecorder, including IEEE 1394, ATAPI, and SCSI.

[0122] It will also be noted that the NTSC composite video signal isnoted above for signals passed between the bVD recorder and television,but a component signal in which the luminance signal and colordifference signal are sent separately could be used.

[0123] Digital interfaces such as DVI are also being developed toreplace the analog interface used for video transfers between the AVequipment and television, and the DVD recorder and television areexpected to be connected via a digital interface before long.

2. Functional Summary of a DVD Recorder

[0124]FIG. 2 is a block diagram showing the functions of a DVD recorder.A typical DVD drive has an optical pickup 101 for reading data from aDVD-RAM disc 100, an ECC (error correction code) processor 102, trackbuffer 103, switch 104 for changing track buffer 103 input and output,an encoder 105, and a decoder 106.

[0125] As shown in the figure data is recorded to a DVD-RAM disc 100 insector units as the smallest recording unit. One sector contains 2 KB ofdata. Sectors are then grouped into ECC blocks with 32 sectors/ECCblock. The ECC processor 102 applies error correction to ECC blockunits.

[0126] The DVD recorder may also use semiconductor memory cards or harddisk drives as data storage media in addition to DVD discs. FIG. 4 is ablock diagram of a DVD recorder equipped with a semiconductor memorycard and hard disk drive in addition to a DVD disc drive.

[0127] It should be noted that one sector could be 512 bytes, 8 KB, orother unit. Each ECC block could also contain only 1 sector, or 16sectors, 64 sectors, or other number of sectors. As the amount of datathat can be stored to the disc increases, both the sector size andnumber of sectors in each ECC block are expected to increase.

[0128] The track buffer 103 records AV data at a variable bit rate (VBR)so that AV data can be recorded more efficiently to the DVD-RAM disc100. The DVD-RAM disc 100 read/write rate (Va) is a fixed rate, but thebit rate (Vb) of the AV data varies according to the complexity of thecontent (images in the case of video). The track buffer 103 is thereforeused as a buffer to absorb this difference between the read/write rate(Va) and AV data bit rate (Vb).

[0129] By using this track buffer 103 even more effectively the AV datacan be recorded non-contiguously to the disc 100 as described below withreference to FIGS. 3A and 3B.

[0130]FIG. 3A shows the address space of an optical disc. When AV datais recorded to contiguous area [a1, a2] and contiguous area [a3, a4]that is non-contiguous to [a1, a2] as shown in FIG. 3A, continuousplayback of the AV data while seeking from a2 to a3 can be sustained bysupplying data accumulated in the track buffer 103 to the decoder 106.This is shown in FIG. 3B.

[0131] AV data read starting from address a1 is input to the trackbuffer 103 from time t1 while data output from the track buffer 103 alsostarts. Data thus accumulates in the track buffer 103 at the rate(Va-Vb), that is, the difference between the track buffer input rate Vaand the track buffer output rate Vb. This continues to the end ofcontiguous area [a1, a2] at location a2, that is, time t2. If the amountof data accumulated in the track buffer 103 during this time is B(t2),data can be supplied to the decoder 106 during the period from time t2to time t3 at which reading from location a3 starts by consuming thedata B(t2) stored in track buffer 103.

[0132] In other words, if at least a certain minimum amount of data([a1, a2]) is stored before the seek operation, the AV data can becontinuously supplied to the decoder when a seek occurs.

[0133] The size of the contiguous area enabling AV data to becontinuously supplied to the decoder when converted to the number of ECCblocks N_ecc can be determined from the following equation:

N _(—) ecc=Vb*Tj/((N _(—) sec*8*S_size)*(1−Vb/Va))

[0134] where N_sec is the number of sectors per ECC block, S_size is thesector size, and Tj is the seek performance (maximum seek time).

[0135] There could also be a defective sector in the contiguous area.The size of the contiguous area considering this factor can bedetermined from the following equation:

N _(—) ecc=dN _(—) ecc+Vb*(Tj+Ts)/((N_sec*8*S_size)*(1−Vb/Va))

[0136] where dN_ecc is the tolerated defective sector size, and Ts isthe time required to skip a defective sector in the contiguous area. Theresulting size is also expressed as the number of ECC blocks.

[0137] Reading, that is reproducing, data from a DVD-RAM disc is used byway of example above and it will be obvious that the same conceptapplies to writing, that is, recording, data to a DVD-RAM disc.

[0138] It will thus be apparent that non-contiguously recorded AV datacan be continuously reproduced from and recorded to a DVD-RAM discinsofar as a certain minimum amount of data is contiguously recorded tothe disc. This area is referred to as a contiguous disc area (CDA) withrespect to DVD media.

3. Summary of a DVD Disc

[0139]FIGS. 5A and 5B show a plan view and physical structure of aDVD-RAM disc as a type of recordable optical disc. It should be notedthat a DVD-RAM disc is usually loaded to a DVD recorder in a disccartridge to protect the recording surface of the disc. However, if therecording surface is protected by some other means or a certain amountof surface damage is tolerable, the disc could be loaded directly to theDVD recorder without using a disc cartridge.

[0140] DVD-RAM media are phase change recording media. Data recorded tothe disc is managed in sector units, and is recorded with an addressenabling access. As noted above, 32 sectors are grouped as one errorcorrection unit to which an error correction code is added. This unit iscalled an ECC block.

[0141]FIG. 5A is a plan view showing the recording area of a DVD-RAMdisc as exemplary of a recordable optical disc. The DVD-RAM disc has alead-in area in the center at the inside circumference, a lead-out areaaround the outside circumference, and a data area between the lead-inarea and lead-out area. Reference signals for servo stabilization whenthe optical pickup accesses the disc, and media identification signalsenabling the type of optical disc to be identified, are recorded in thelead-in area. The same reference signals and media ID signals are alsorecorded to the lead-out area. The data area is segmented into sectors(each storing 2048 bytes) as the smallest access unit.

[0142] The data area of a DVD-RAM disc is also segmented into multiplezones so that a rotational control method called Z-CLV (Zone ConstantLinear Velocity) can be used for recording and playback.

[0143]FIG. 5A shows plural zones formed concentrically on the DVD-RAMdisc. In this example the DVD-RAM disc is divided into 24 zones,labelled zone 0 to zone 23. The rotational angular velocity of theDVD-RAM is set differently in each zone such that it increases inproximity to the inside circumference and is constant while the opticalpickup accesses data in the same zone. This increases the recordingdensity of the DVD-RAM and enables easier rotational control duringrecording and playback.

[0144]FIG. 5B shows the lead-in area, lead-out area, and zones 0 to 23concentrically arranged in FIG. 5A when viewed in a line through thedisc radius.

[0145] The lead-in area and lead-out area each include a defectmanagement area (DMA). The defect management area is for recordinglocation information indicating the location of a sector containing adefect, and substitute sector location information indicating in whichsubstitute area the sector substituted for the defective sector islocated.

[0146] Each zone includes a user area in the center of the zone, and asubstitute area and an unused area at the boundary of the zone. The userarea is the area that can be used by the file system as a recordingarea. The substitute area is the area substituted for a defective sectorin the zone. The unused area is an area not used for data recording, andis approximately two tracks wide. The sector address is recorded to thesame position in adjacent tracks within each zone, but with Z-CLV thesector address is recorded to a different position in tracks adjacent tothe zone boundary. This unused area is therefore provided to preventsector address detection errors in tracks adjacent to the zone boundary.

[0147] There are, therefore, sectors not used for data recording at thezone boundaries. A logical sector number (LSN) is therefore assigned toeach physical sector in the user area of a DVD-RAM disc to continuouslyidentify only those sectors used for data recording sequentially fromthe inside circumference.

[0148]FIGS. 6A and 6B show the logical data space of a DVD-RAM disccomprising logical sectors. The logical data space is called the “volumespace” and is used to record user data.

[0149] Data recorded in the volume space is managed with a file system.More specifically, volume structure information for managing a group ofsectors storing data as a “file” and a group of files as a “directory”is recorded to the beginning and end of the volume area. This embodimentof the invention uses the UDF file system as defined in ISO 13346.

[0150] The above-noted group of sectors are not necessarily locatedcontiguously within the volume space, and can be split into separateparts. Of the sectors constituting each file, the file system thereforemanages each group of contiguous sectors in the volume space as anextent, and manages each file as a set of related extents.

[0151]FIGS. 7A and 7B show the structure of a directory and filerecorded to DVD-RAM. Below the root directory is the VIDEO_RT directory,and below VIDEO_RT are the various object files containing the playbackdata and a VIDEO Manager file containing management information such asthe playback sequence and various attributes.

[0152] Objects are data structures conforming to MPEG standards, andinclude PS_VOB, TS1_VOB, TS2_VOB, AOB, POB, and MNF (Manufacturer'sPrivate Data).

[0153] PS_VOB, AOB, and POB are MPEG program streams (PS), and TS1_VOBand TS2_VOB are MPEG transport streams (TS). The program stream has adata structure designed for storing AV data to package media. Thetransport stream has a data structure intended for communications media.

[0154] PS_VOB, TS1_VOB and TS2_VOB are objects of primarily video databut containing both video data and audio data. In principle, TS1_VOBobjects are encoded by the DVD recorder with an explicitly managedinternal picture structure. TS2_VOB objects are encoded externally tothe DVD recorder, and part of the internal picture structure and datastructure is unknown.

[0155] Typically, TS1_VOB is an object obtained by encoding externallyinput analog video signal by the DVD recorder to the transport stream,and TS2_VOB is an object obtainded by recording externally input digitalvideo signal directly to the disc without further encoding by the DVDrecorder.

[0156] AOB and POB are MPEG program streams. AOB objects containprimarily audio data, and POB objects contain primarily still pictures.

[0157] The MNF is used to store information specific to a particularmanufacturer. “Primarily video data” and “primarily audio data” aboveindicate that a high bit rate is allocated. VOB are used in movingpicture and similar applications, and AOB are used in musicapplications.

4. Summary of Reproduced AV Data

[0158]FIG. 8 shows the structure of MPEG data recorded as AV objects toa DVD.

[0159] As shown in FIG. 8, the video stream and audio stream aresegmented and multiplexed. The MPEG standard refers to the multiplexedstreams as the system stream. In the case of DVD, a system stream inwhich DVD-specific information is set is called a VOB (Video OBject).The segmentation unit is called “pack” or “packet”, and is approximately2 KB in size.

[0160] The video stream is encoded according to the MPEG standard, whileit is compressed with variable bit rate such that the bit rate isincreased in complex images such as images containing much movement. Thepictures in an MPEG stream are encoded as I-pictures, P-pictures, orB-pictures. I-pictures are spatially compressed and complete within eachframe. P-pictures and B-pictures are temporally compressed usinginter-frame correlations. A series of pictures including at least oneI-picture is referred to as a Group of Pictures (GOP) in MPEG. GOP isthe access point for fast play and other special play modes, which aremade possible by the presence of at least one intra-frame compressedI-picture.

[0161] In addition to using MPEG audio, the audio stream of a DVD can beencoded using AC-3, LPCM, or other encoding technique.

[0162] As also shown in FIG. 8 the Video Object Unit (VOBU) is the dataunit multiplexing the video data of a GOP with the associated audiodata. VOBU may include information to manage a section of the movingpicture achieved by itself as header information.

[0163] A program stream (PS) and transport stream (TS) are included inthe system stream described with reference to FIG. 8. As noted above,the program stream has a data structure intended for package media andthe transport stream data structure is intended for communicationsmedia.

[0164]FIG. 9 shows the concept of the program stream and transportstream data structures.

[0165] The program stream contains fixed length packs that are thesmallest unit for data transfer and multiplexing. Each pack contains oneor more packets. Both packs and packets have a header part and a datapart. The data part is referred to as the payload in MPEG. Forcompatibility with the sector size, the fixed length of a pack in DVD is2 KB. A pack can contain multiple packets, but because packs storing DVDvideo and audio contain only one packet, 1 pack equals 1 packet exceptin special cases.

[0166] The data transfer and multiplexing unit of the transport streamcontains fixed length TS packets. TS packet size is 188 bytes forcompatibility with ATM transmissions, a communications standard. One ormore TS packets form a PES packet.

[0167] The PES packet concept is common to both the program stream andtransport stream, and the data structure is the same. Packets stored inprogram stream packs directly form PES packets, and a group of one ormore transport stream TS packets form a PES packet.

[0168] The PES packet is the smallest encoding unit and stores videodata and audio data with common encoding. More specifically, video dataand audio data encoded with different coding methods are not present inthe same PES packet. However, if the coding method is the same, it isnot necessary to ensure the picture boundaries and audio frameboundaries. As shown in FIG. 9 plural frames may be stored to one PESpacket.

[0169]FIGS. 10A to 10C and FIGS. 11A and 11C show the data structures ofthe transport stream and program stream.

[0170] As shown in FIGS. 10A to 10C and FIGS. 12A to 12D, each TS packetcontains a TS packet header, adaptation field, and payload. The TSpacket header stores a Packet Identifier (PID) whereby the video, audio,or other stream to which the TS packet belongs can be identified.

[0171] The Program Clock Reference (PCR) is stored to the adaptationfield. The PCR is the reference value for the system time clock (STC) ofthe device decoding the stream. The device typically demultiplexes thesystem stream based on the PCR timing, and then reassembles the videostream and other streams.

[0172] The Decoding Time Stamp (DTS) and Presentation Time Stamp (PTS)are stored to the PES header. The DTS denotes the decoding timing of thepicture or audio frame stored to the PES packet, and the PTS denotes thepresentation timing of the video or audio output.

[0173] It should be noted that the PTS and DTS need not be written toevery PES packet header. Decoding and output are possible insofar as thePTS and DTS are written to the header of the PES packet where the firstdata of the I-picture is stored.

[0174] The TS packet structure is shown in detail in FIGS. 12A to 12D.

[0175] As shown in FIGS. 12B to 12D, the adaptation field stores the PCRand a random access presentation flag. This flag indicates whether datathat is at the beginning of the video or audio frame and can be used asan access point is stored in the corresponding payload. In addition tothe above-noted PID, the TS packet header also stores a unit startindication flag indicating the beginning of a PES packet, and adaptationfield control data indicating whether an adaptation field follows.

[0176]FIG. 11A to 11C show the structure of packs in the program stream.A pack contains the SCR in the pack header and a stream_id in the packetheader of packets stored in the pack. The SCR is effectively identicalto the transport stream PCR, and the stream_id to the PID. The PESpacket data structure is also the same as in the transport stream, andthe PTS and DTS are stored in the PES header.

[0177] One major difference between the program stream and transportstream is that the transport stream allows for multiple programs. Thatis, in terms of program units, the program stream can carry only oneprogram but the transport stream can simultaneously transmit multipleprograms. This means that the playback device must be able to identifythe video streams and audio streams constituting each program carried inthe transport stream.

[0178]FIGS. 13A and 13B show the PAT table and PMAP table used totransmit structure information for the audio stream and video stream ofeach program. As shown in FIGS. 13A and 13B, the PMAP table storesinformation relating to the combination of video and audio streams usedin each program, and the PAT table stores information correlatingprograms and PMAP tables. The playback device can therefore referencethe PAT table and PMAP table to detect the video and audio streams forthe program to be output.

[0179] How the program stream packs and transport stream TS packetsdescribed above are arranged on the disc is described next withreference to FIGS. 14A to 14C.

[0180] As shown in FIG. 14A there are 32 sectors in an ECC block.

[0181] As shown in FIG. 14B, the packs (PS Packs) forming a video object(PS_VOB) of a program stream type are located at the sector boundaries.This is because the pack size and sector size are both 2 KB.

[0182] Video objects (TS1_VOB, TS2_VOB) in the transport stream format,however, is recorded to have a 188 byte packet paired with a 4 byteArrival Time Stamp (ATS) denoting the decoder input time. When recordingan externally encoded stream, the ATS is generated and added by the DVDrecorder, and indicates the timing at which the packet was received bythe DVD recorder from an external source.

5. Summary of AV Data Management Information and Playback Control

[0183]FIGS. 15A and 15B and FIGS. 16A and 16B show the data structure ofthe video management information file (Video Manager) shown in FIG. 7Aand 7B.

[0184] The video management information includes object informationdescribing such management information as where objects are recorded ondisc, and playback control information describing the playback sequenceof the objects.

[0185]FIG. 15 shows an example in which the objects recorded to the discinclude PS_VOB#1—PS_VOB#n, TS1_VOB#1—TS1_VOB#n, and TS2_VOB#1—TS2_VOB#n.

[0186] As shown in FIGS. 15A and 15B, a PS_VOB information table,TS1_VOB information table, and TS2_VOB information table are separatelyrecorded according to the object types. Each of these tables stores VOBinformation for each object.

[0187] The VOB information includes general information about thecorresponding object, object attribute data, an access map forconverting the object playback time to a disc address value, andmanagement information for the access map. The general informationincludes identification information for the corresponding object andobject recording time. The attributes include video stream attributes(V_ATR) such as the video stream coding mode, the number of audiostreams (AST_Ns), and audio stream attributes (A_ATR) such as the audiostream coding mode.

[0188] There are two reasons why an access map is required. The first isso that program chain information (playback path information to define aplayback path) avoids directly referencing object recording positionsbased on a sector address value, for example, and instead can indirectlyreference object locations based on the object playback time. Objectrecording positions can change with RAM media as a result of editing theobject, for example. This increases the amount of program chaininformation that must be updated if the program chain informationreferences object recording positions directly based on the sectoraddress. If the objects are referenced indirectly based on the playbacktime, however, it is not necessary to update the program chaininformation and only the access map needs to be updated.

[0189] The second reason is that the audio stream typically has tworeference bases, the time base and data (bit stream) base, but thecorrelation therebetween is not perfect.

[0190] For example, using a variable bit rate (a method of changing thebit rate according to the complexity of the image) is becoming the normwith MPEG-2 Video, an international standard for video stream encoding.In this case there is no proportional relationship between the amount ofdata from the stream start and playback time, and random access based onthe time base is therefore not possible. An access map is used toresolve this problem by converting between the time base and data (bitstream) base.

[0191] As shown in FIG. 15A, the playback control information includes auser-defined program chain information table, original program chaininformation table, and title search pointer.

[0192] As shown in FIG. 16A there are two types of program chaininformation: originally defined program chain information generatedautomatically by the DVD recorder to describe all objects recordedduring object recording, and user-defined program chain informationenabling a user to freely define a particular playback sequence. Theprogram chain information is uniformly referred to as PGC information ona DVD, the user-defined program chain information is referred to as theU_PGC information, and the original program chain information as theO_PGC information. The U_PGC information and O_PGC information aretables listing the cell information describing the cells in the objectplayback period. The object playback period indicated by the O_PGCinformation is called an original cell (O_CELL), and the object playbackperiod indicated by the U_PGC information is called a user cell(U_CELL).

[0193] A cell indicates the object playback period using the objectplayback start time and playback end time; the playback start and endtimes are converted by the access map described above to the actuallocation where the object is recorded on disc.

[0194] As shown in FIG. 16B a cell group indicated by the PGCinformation defines a continuous playback sequence reproducedsequentially according to the order of entries in the table.

[0195]FIG. 17 shows a specific relationship between objects, cells, PGC,and access map.

[0196] As shown in FIG. 17 the original PGC information 50 contains atleast one cell information 60, 61, 62, 63.

[0197] Each cell information 60, 61, . . . defines the object to bereproduced as well as the object type, and object playback period. Theorder of the cell information in the PGC information 50 defines theplayback sequence of the objects defined by each cell when the objectsare reproduced.

[0198] Each cell information (cell information 60, for example) includesa Type 60 a indicating the type of specific object, an Object ID 60 bidentifying a particular object, and a start presentation time Start_PTM60 c and end presentation time End_PTM 60 d in the object on the timebase.

[0199] During data playback, the cell information 60 is sequentiallyread from the PGC information 50, and the objects specified by each cellare reproduced for the playback period defined by the cell.

[0200] The access map 80 c converts the start and end time informationcontained in the cell information to the object address on disc.

[0201] This access map is the map information described above and isgenerated and recorded when the objects are recorded. The picturestructure of the object data must be analyzed in order to generate themap. More specifically, it is necessary to detect the I-picture locationshown in FIG. 9, and detect the PTS and other time stamp data, that is,the I-picture playback time shown in FIG. 10 and FIG. 11.

[0202] Problems occurring when generating the PS_VOB, TS1_VOB, andTS2_VOB map information are described next.

[0203] As described with reference to FIG. 1, the PS_VOB and TS1_VOB areprimarily generated by the DVD recorder encoding a received analogbroadcast to an MPEG stream. The I-picture and time stamp data aretherefore generated by the DVD recorder, the internal data structure ofthe stream is known to the DVD recorder, and the map information can begenerated with no problem.

[0204] As also described with reference to FIG. 1, the TS2_VOB is areceived digital broadcast recorded directly to the disc by the DVDrecorder with no intermediate encoding. Because the recorder thus doesnot generate the time stamp information and determine the I-picturelocations as it does when recording a PS_VOB, the DVD recorder does notknow the internal data structure of the stream and must therefore detectthis information from the recorded digital stream.

[0205] To do this the DVD recorder detects the I-picture and time stampinformation as described below for the map information of a TS2_VOBrecording a stream encoded externally to the recorder.

[0206] First, I-pictures are detected by detecting the random accessindication information (random_access_indicator) of the TS packetadaptation field shown in FIG. 12 or detecting the unit start indicationinformation (payload_unit_start_indicator) in the TS packet header. Thetime stamp is detected by detecting the PTS in the PES header. Note thatthe PCR from the adaptation field or the TS packet arrival time at theDVD recorder can be used instead of the PTS for the time stamp. In anycase, the DVD recorder detects I-picture locations based on informationin a high level system layer and does not need to analyze the datastructure of the MPEG stream video layer. This is because the systemoverhead required to analyze the video layer in order to generate themap information is great.

[0207] There are also cases in which system layer detection is notpossible. The map information cannot be generated in such cases and itis therefore necessary to indicate that there is no valid mapinformation. The DVD recorder indicates this using the map managementinformation shown in FIG. 15 (b).

[0208] The map management information shown in FIG. 15(b) contains mapvalidity information and a self-encoding flag. The self-encoding flagindicates that an object was encoded by the DVD recorder, and thusindicates that the internal picture structure is known and that the mapinformation time stamp information and I-picture location information isaccurate. The map validity information indicates whether or not there isa valid access map.

[0209] Examples of when the system layer cannot be detected include whenthe adaptation field is not set and when the digital stream is not anMPEG transport stream. Various digital broadcasting standards andformats are used around the world, and there will naturally be cases inwhich the DVD recorder records objects for which it cannot generate amap. For example, if a DVD recorder designed for the Japanese market andrecording digital broadcasts in Japan is used in the United States torecord digital broadcasts in the United States, there will likely becases in which the DVD recorder cannot generate a map for the recordedobjects.

[0210] The DVD recorder can, however, sequentially reproduce from thebeginning objects for which map information is not generated. In thiscase video from the recorded digital stream can be reproduced byoutputting it through a digital interface to a STB appropriate to thestream.

6. Basic Operation of the Playback Function

[0211] The playback operation of a DVD recorder/player for reproducingcontent recorded to an optical disc as described above is described nextbelow with reference to FIG. 18.

[0212] As shown in FIG. 18 the DVD player has an optical pickup 201 forreading data from the optical disc 100, an ECC processor 202 for errorcorrection processing of the read data, a track buffer 203 fortemporarily storing the read data after error correction, a PS decoder205 for reproducing video objects (PS_VOB) and other program streams, aTS decoder 206 for reproducing digital broadcast objects (TS2_VOB) andother transport streams, an audio decoder 207 for reproducing audioobjects (AOB), a still picture decoder 208 for decoding still pictureobjects (POB), a switching means 210 for changing data input to thedecoders 205 to 208, and a controller 211 for controlling the variousparts of the player.

[0213] Data recorded to the optical disc 100 is read by the opticalpickup 201, passed through the ECC processor 202 and stored to trackbuffer 203. Data stored to the track buffer 203 is then input to anddecoded and output by the PS decoder 205, TS decoder 206, audio decoder207, or still picture decoder 208.

[0214] The controller 211 determines what data to read based on theplayback sequence defined by the program chain information (PGC) shownin FIGS. 16A and 16B. Using the example shown in FIGS. 16A and 16B, thecontroller 211 thus first reproduces part (CELL #1) of VOB #1, then part(CELL #2) of VOB #3, and finally VOB #2 (CELL #3).

[0215] Using the cell information of the program chain information (PGC)shown in FIG. 17, the controller 211 can also capture the type of cellreproduced, corresponding objects, and the playback start and end timesof the objects. The controller 211 inputs data for the object periodidentified from the cell information to the appropriate decoder.

[0216] The controller 211 also identifies the objects to be reproducedbased on the Object ID of the cell information. The controller 211 alsoidentifies the cell, which is the playback period of the identifiedobject, by converting the Start_PTM and End_PTM of the cell informationto a disc address value by referencing the access map of thecorresponding VOB information.

[0217] A player according to this embodiment of the invention also has adigital interface 204 for supplying the AV stream to an external device.It is therefore possible to supply the AV stream to an external devicethrough an IEEE 1394, IEC 958, or other communications means. This is sothat, for example, when the player does not have an internal decoder fordecoding a TS2_VOB not encoded by the recorder/player the TS2_VOB can beoutput directly without decoding through the digital interface 204 to anexternal STB for decoding and presentation via the STB.

[0218] When the digital data is directly output to an external device,the controller 211 determines whether random access playback is possiblebased on the map information shown in FIG. 15(b). If the access pointdata flag (random access presentation flag) is valid, the access mapcontains I-picture location information. In this case the controller 211is able to access and output digital data containing an I-picture to anexternal device through the digital interface in response to fast playand other requests from the external device. Furthermore, time-baseaccess is also possible if the time access information flag is valid. Inthis case the controller 211 can access and output digital dataincluding the picture data at a specified playback time to an externaldevice through the digital interface in response to a time-base accessrequest from an external device.

7. Basic Operation of the Recording Function

[0219] The configuration and operation of a DVD recorder according tothe present invention for recording and reproducing an optical disc asdescribed above is described next below with reference to FIG. 19.

[0220] As shown in FIG. 19 the DVD recorder has a user interface 222 forreceiving user requests and displaying information and prompts to theuser, a system controller 212 handling the overall management andcontrol of the DVD recorder, an analog broadcast tuner 213 for receivingVHF and UHF broadcasts, an encoder 214 for converting analog signals todigital signals and encoding the digital signals to an MPEG programstream, a digital broadcast tuner 215 for receiving digital satellitebroadcasts, an analyzer 216 for interpreting the MPEG transport streamsent from a digital satellite, a presentation unit 217 such as atelevision and speakers, and a decoder 218 for decoding the AV stream.The decoder 218 has first and second decoders, for example, such asshown in FIG. 18. The DVD recorder also has a digital interface 219,track buffer 220 for temporarily storing write data, a drive 221 forwriting data to the disc, and a converter 223. The digital interface 219is an IEEE 1394 or other communications interface for outputting data toan external device. The converter 223 converts the transport stream to aprogram stream according to the flow chart shown in FIG. 37 anddescribed further below.

[0221] With a DVD recorder thus comprised the user interface 222 firstreceives a request from the user. The user interface 222 then passes therequest to the system controller 212, and the system controller 212interprets the user request and instructs the various modules to runappropriate processes.

[0222] Recording includes self-encoding in which the DVD recorderencodes the input digital data, and outside encoding for recordingalready encoded digital data to disc without further encoding.

[0223] 7.1 Recording by Self-encoding

[0224] Recording with self-encoding is described first below using byway of example encoding and recording an analog broadcast to a PS_VOBstream.

[0225] The system controller 212 sends a receive command to the analogbroadcast tuner 213 and an encode command to the encoder 214.

[0226] The encoder 214 then video-encodes, audio-encodes, andsystem-encodes the AV data from the analog broadcast tuner 213, andpasses the encoded data to the track buffer 220.

[0227] Immediately after encoding starts, the encoder 214 sends the timestamp data at the beginning of the MPEG program stream being encoded tothe system controller 212 as the playback start time (PS VOB_V_S_PTM),and parallel to the encoding process sends the data required to createthe access map to the system controller 212. This value is set as theStart_PTM of the cell information shown in FIG. 17 and generated later.The time stamp information is generally the PTS, but the SCR can be usedinstead.

[0228] The system controller 212 then sends a record command to thedrive 221, and the drive 221 thus extracts and records data accumulatedin the track buffer 220 to the DVD-RAM disc 100. A contiguous data area(CDA) as described above is also found in the recordable area of thedisc and the data is recorded to the located contiguous data area.

[0229] Recording typically ends when the user inputs a stop recordingcommand. Stop recording commands from the user are input through theuser interface 222 to the system controller 212, and the systemcontroller 212 then sends a stop command to the analog broadcast tuner213 and encoder 214.

[0230] The encoder 214 stops encoding when it receives the stop encodingcommand from the system controller 212, and sends the time stamp data ofthe last data in the last encoded MPEG program stream to the systemcontroller 212 as the playback end time (PS_VOB_V_E_PTM). This value isset as the End_PTM of the cell information shown in FIG. 17. The PTS isnormally used for the time stamp information but the SCR can be usedinstead.

[0231] After ending the encoding process the system controller 212generates the playback control information and VOB information (PS_VOBI)for the PS_VOB shown in FIG. 15.

[0232] The VOB information generated here includes map managementinformation and an access map appropriate to the object type. The systemcontroller 212 sets the map validity information of the map managementinformation to “valid,” and sets the self-encoding flag ON.

[0233] Original playback information (O_PGC information, see FIGS. 16Aand 16B) in which the object to be recorded is one of the playbackobjects is generated as the playback control information. This O_PGCinformation is added to the original program chain information table.The original program chain information (O_PGC information) contains cellinformation. The cell information Type is set to PS_VOB.

[0234] The system controller 212 then instructs the drive 221 to stoprecording data accumulated in the track buffer 220 and to record the VOBinformation (PS_VOBI) for PS_VOB and playback control information. Thedrive 221 thus records this information and the remaining data in thetrack buffer 220 to the optical disc 100, and the recording processends.

[0235] It will be obvious that an analog broadcast could be encoded toTS1_VOB. In this case the encoder 214 must be an encoder for convertingthe analog signal to a digital signal and encoding the digital signal tothe MPEG transport stream, and the type information in the cellinformation is set to TS1_VOB. The PTS or PCR can be used for theStart_PTM and End_PTM.

[0236] 7.2 Recording by outside encoding

[0237] Recording with outside encoding is described next below withreference to recording a digital broadcast. The recorded object type inthis case is TS2_VOB.

[0238] A digital broadcast recording request from the user is passedfrom the user interface 222 to the system controller 212. The systemcontroller 212 then instructs the digital broadcast tuner 215 to receiveand instructs the analyzer 216 to analyze the received data.

[0239] An MPEG transport stream sent from the digital broadcast tuner215 is passed through the analyzer 216 to the track buffer 220.

[0240] To generate the VOB information (TS2_VOBI) of the encoded MPEGtransport stream (TS2_VOB) received as a digital broadcast, the analyzer216 first extracts the time stamp data at the beginning of the transportstream as the start time information (TS2_VOB_V_S_PTM) and sends it tothe system controller 212. This start time value is set as the Start PTMof the cell information shown in FIG. 17 and generated later. The timestamp information is the PCR or PTS. The timing at which the object issent to the DVD recorder could alternatively be used.

[0241] The analyzer 216 then analyzes the system layer of the MPEGtransport stream to detect the information needed for access mapgeneration. The I-picture locations in the object are detected based onthe random access indicator (random_access_indicator) in the adaptationfield of the TS packet header as described above, or the unit startindication information (payload_unit_start_indicator) in the TS packetheader.

[0242] The system controller 212 then outputs a record command to thedrive 221, and the drive 221 thus extracts and records data accumulatedin the track buffer 220 to the DVD-RAM disc 100. The system controller212 also instructs the drive 221 where to record on the disc based onthe file system allocation data. A contiguous data area (CDA) asdescribed above is also found in the recordable area of the disc and thedata is recorded to the located contiguous data area.

[0243] Recording typically ends when the user inputs a stop recordingcommand. Stop recording commands from the user are input through theuser interface 222 to the system controller 212, and the systemcontroller 212 then sends a stop command to the digital broadcast tuner215 and analyzer 216.

[0244] In response to the received stop command from the systemcontroller 212, the analyzer 216 stops analyzing the received data andsends the time stamp data at the end of the last analyzed MPEG-TS to thesystem controller 212 as the playback end time (TS2_VOB_V_E_PTM). Thisvalue is set as the End_PTM of the cell information shown in FIG. 17.The PCR or PTS is used for the time stamp information but the timingwhen the object was sent to the DVD recorder can be used instead.

[0245] After ending the digital broadcast reception process, the systemcontroller 212 generates the playback control information and VOBinformation (TS2_VOBI) for the TS2_VOB as shown in FIG. 15 based on theinformation received from the analyzer 216.

[0246] The VOB information generated here includes map managementinformation and an access map appropriate to the object type. The systemcontroller 212 sets the map validity information of the map managementinformation to “valid” when the I-picture locations in the objects weredetected and the access map could be generated. The self-encoding flagis set OFF. When a valid access map could not be generated the mapvalidity information is set to an “invalid” state. Examples of when avalid access map cannot be generated include when a correspondingdigital broadcast is not received and when there is no random accessinformation set in the adaptation field. When the signal is inputdirectly through the digital interface the signal may also not be anMPEG transport stream, and in this case, too, the map validity flag isset to “invalid.”

[0247] Original playback information (O_PGC information) as shown inFIGS. 16A and 16B for the recorded object as one of the playback objectsis generated as the playback control information. This O_PGC informationis added to the original program chain information table. The originalprogram chain information (O_PGC information) contains cell informationof which type information is set to “TS2_VOB”.

[0248] The system controller 212 then instructs the drive 221 to stoprecording data accumulated in the track buffer 220 and to record the VOBinformation (TS2_VOBI) for TS2_VOB and playback control information. Thedrive 221 thus records this information and the remaining data in thetrack buffer 220 to the optical disc 100, and the recording processends.

[0249] While the above recording operations are described with referenceto recording start and end commands input by the user, it will beobvious that the same essential operation applies to timer recordingssuch as used in a VCR, for example. In this case the system controllerautomatically issues the recording start and end commands instead of theuser, and there is no essential change in DVD recorder operation.

8. Main Concept of the Invention

[0250] A data recording medium according to the present invention is amedium for recording data of various different formats, including analogbroadcast or digital broadcast content and various types of data inputthrough an analog/digital interface. A data recording apparatusaccording to the present invention is an apparatus for recording AV datato the same data recording medium.

[0251] More particularly, externally input AV data is recorded as anMPEG-TS, and a stream adding decoder input time information (time stampinformation) for each MPEG-TS packet to each MPEG-TS packet is recordedto the data recording medium of the present invention. The time stampinformation added to the MPEG-TS packets and the time stamp informationadded to the MPEG-PS packs after conversion are correlated based on aspecific relation.

[0252]FIG. 20 shows an MPEG transport stream (MPEG-TS) and theconversion of an MPEG-TS to an MPEG program stream. As shown in thisfigure the MPEG-TS contains a PSI (Program Specific Information) packetcontaining MPEG-TS control information, places recorder-specific andcontent-specific information in a private use stream (Tip packet), andrecords the decoder input time (ATS) for each packet in a formatappropriate to accumulation.

[0253] For easier conversion from a multiplexed MPEG-TS to an MPEG-PS, aspecific number (one or more) of MPEG-TS packets are system-encoded toone continuous unit for multiplexing (multiplexing unit) for recordingas an MPEG-TS. One multiplexing unit is determined so that data amountof one multiplexing unit corresponds to that of one MPEG-PS data pack.Introducing this multiplexing unit concept makes it simple to convertfrom an MPEG-TS to MPEG-PS by simply converting MPEG-TS packets inmultiplexing units to MPEG-PS video packs or audio packs, and an MPEG-TScan therefore be easily converted to an MPEG-PS.

9. Detailed Description of the Embodiments

[0254] 9.1 Encoder Configuration

[0255] The encoder of a data recording apparatus according to thepresent invention is described next below using by way of exampleself-encoding AV input to an MPEG-TS.

[0256] The configuration of an encoder in a data recording apparatusaccording to the present invention is shown in FIG. 21. The encoderreceives video, audio, and vertical blanking interval (VBI) signals toencode them to a transport stream.

[0257] Encoder operating modes include a DVD-Video compatibility mode,DVD Video Recording compatibility mode, and a normal mode. The encodergenerates an MPEG-TS that can be easily converted by the method furtherdescribed below to the DVD-Video standard when in the DVD-Videocompatibility mode, generates an MPEG-TS that can be easily converted bythe method described below to the DVD Video Recording (“DVD VR” below)standard when in the DVD Video Recording compatibility mode, andgenerates an MPEG-TS having specific attributes when in the normal mode.When recording in the normal mode it is acceptable to use audio codingmethods other than those defined by the DVD standards, and tolerancevalues in the video coding method (such as the GOP length) may beoutside the range of values defined by the DVD standards.

[0258] 9.2 Self-encoded MPEG-TS

[0259] A preferred embodiment of an MPEG-TS format self-encoded by adata recording apparatus according to the present invention is describedbelow, specifically describing the differences between a normal MPEG-TS(below labelled “SESF”) and an MPEG-TS that can be easily converted toan MPEG-PS (below called a “Constrained SESF”).

[0260] In the example described below, each MPEG-TS stream storesinformation describing encoding conditions for the stream in a VOBIstoring attribute information. By thus storing information describingencoding conditions in the management information, that is, outside thestream, it can be quickly determined whether or not the stream can beeasily converted to a DVD-Video or DVD VR format without analyzing thestream. This information about the stream encoding conditions can bestored to the Tip packet (described below).

[0261] These stream encoding conditions are stored in a 2-bit “encodecondition” flag. The values of this flag are defined below.

[0262] 00b: normal MPEG-TS (SESF)

[0263] 01b: MPEG-TS that can be easily converted to a stream in DVD VRformat (Constrained SESF)

[0264] 10b: reserved

[0265] 11b: MPEG-TS that can be easily converted to a stream inDVD-Video format (Constrained SESF)

[0266] Whether a stream can be easily converted to a DVD-Video or DVD VRstream format can thus be easily determined by reading theencode_condition field of the VOBI set as described above. It will benoted that “easily converted” as used herein means convertible by themethod described below.

[0267] 9.3 Constrained SESF Stream Format

[0268] The stream format of a Constrained SESF transport stream is shownin FIG. 55. A Constrained SESF contains plural SESF capsules. A SESFcapsule starts with a Tip packet (described in detail below) andcontains a specified number of multiplexing units. The presentation timestamp (PTS) of each SESF capsule and the Tip packet address informationis correlated by an address map. As will become clear below, in TS2PSconversion, a conversion process is performed for each SESF capsule.

[0269]FIG. 20 shows the correlation between each packet in one SESFcapsule and MPEG-PS packs. As shown in FIG. 20 a TS packet (referred toas a Tip packet below) storing specific information about the stream isinserted to a Constrained SESF. The Tip packets embedded in aConstrained SESF are described below with reference to FIG. 23 to FIGS.29A and 29B.

Tip Packet

[0270]FIG. 23 shows the complete structure of a Tip packet. As shownhere each Tip packet stores a Data_ID identifying the packet as a Tippacket, display_and_copy_info corresponding to DCI_CCI field of DVD VRand containing display control and copy control information, encode_infostoring stream encoding information, and MakersPrivateData storing dataspecific to the manufacturer and added by the manufacturer.

[0271] As shown in FIG. 23 and FIG. 24, the PCR value needed for the SCRcalculation further described below is written to the adaptation fieldof the Tip packet. This adaptation field is a fixed byte length and thusenables accessing various information in the Tip packet using a fixedaddress.

[0272]FIG. 25 shows the Data_ID field structure. The Data_ID fieldcontains a Data_identifier for identifying the packet as a Tip packet.This Data_Identifier is a 3-byte field storing value “0×544950” denoting“TIP” in ASCII code. The decoder of the playback drive can identify Tippackets by reading the value of this field.

[0273]FIG. 26 shows the structure of the display_and-copy_info field.Generating the RDI packs when converting the Constrained SESF to the DVDVR format is facilitated by writing the same structure and informationas the DCI_CCI field of the RDI Unit in the DVD VR standard to thisdisplay_and_copy_info field. (It is noted that details about the DCI_CCIfield of the DVD VR standard can be found in “DVD Specifications forRewritable/Re-recordable Disc, Part 3, Video Recording,” and in JapanesePatent No. 3162044. While some of the field names may be different inthese documents, the field definitions are the same so as to enabledirect conversion to the DVD VR format.)

[0274]FIG. 27 shows the structure of the encode_info field. Thevideo_resolution field stores the resolution of the video streamfollowing the Tip packet. The values of this encode_info field aredefined below.

[0275] 0000b: 720×480(NTSC), 720×576(PAL)

[0276] 0001b: 704×480(NTSC), 704×576(PAL)

[0277] 0010b: 352×480(NTSC), 352×576(PAL)

[0278] 0011b: 352×240(NTSC), 352×288(PAL)

[0279] 0100b: 544×480(NTSC), 544×576(PAL)

[0280] 0101b: 480×480(NTSC), 480×576(PAL)

[0281] Others: reserved

[0282] The DVD VR format allows the resolution to change during a singlecontinuous recording. Streams of different resolutions are managed inseparate VOBs, and seamless stream connections are assured duringplayback by the recorder. When the resolution changes during ConstrainedSESF recording, this video_resolution field is used to identify thepoint from which the VOB must change when converted to the DVD VRformat.

[0283] In a Constrained SESF recorded to facilitate conversion to theDVD-Video format (encode_condition=11b) a change in resolution within astream is not permitted.

[0284] The encode_condition field stores the same information stored ina VOBI. The reason why this information is stored not only in the streammanagement information but also embedded in the stream is that even ifthe stream is copied through a digital interface such as IEEE 1394 therecorder receiving the stream can easily determine if the stream can beeasily converted to a DVD format by simply confirming the value of thisencode_condition field in the Tip packet. The recorder can determine theencoding conditions of at least the elementary streams between one Tippacket and the next Tip packet (i.e., the SESF capsule) in the receivedstream.

[0285] VOBU_S_PTM from the DVD VR standard is recorded to the FVFPSTfield. This is to eliminate the need to analyze the encoded video streamfollowing the Tip packet to calculate the playback time of the firstpresented video field when converting a Constrained SESF to a DVD-Videoor DVD VR format.

[0286] The FVFPST field contains a 32-bit field denoting the video fieldpresentation time with 90 kHz precision, and a 16-bit field denoting thepresentation time with 27 MHz precision, which cannot be expressed inthe 32-bit field.

[0287]FIG. 28 shows the MakersPrivateData. As shown in FIG. 28 theMakersPrivateData contains a maker_ID field identifying the manufacturerthat generated the Constrained SESF, and a maker_private_data fieldcontaining other specific information added by the manufacturer.

[0288]FIG. 29A and 29B show exemplary stream_type values denoting theTip packet PID and stream type. Because both PID and stream_type valuesare reserved by the MPEG and other standards, the values used areselected so as to not interfere with these reserved values and to denoteprivate data outside the MPEG standard.

[0289] It will thus be apparent that various stream attributes areextracted and stored to the Tip packet stored in a Constrained SESF. Howthe fields described above are used during conversion to a DVD format isdescribed in further detail below.

[0290] 9.4 System-encoding Conditions

[0291] System-encoding conditions for Constrained SESF are describednext in detail. It should be noted that the following system-encodingconditions are not applicable to an SESF for which the encode_conditionfield is neither set to “01b” or “11b”, that is, an SESF that is not aConstrained SESF.

Multiplexing Unit

[0292] Each TS packet storing the elementary streams of a ConstrainedSESF has a unit for multiplexing (multiplexing unit) of data stored in2-KB packs according to a DVD format.

[0293] Why this concept of multiplexing units is introduced is describedbriefly with reference to FIGS. 57A and 57B. FIG. 57A describesconverting an MPEG-TS in an unconstrained format to an MPEG-PS. Toconvert an MPEG-TS to an MPEG-PS the multiplexing order of the TSpackets (video packets and audio packets) that are the multiplexingunits of the MPEG-TS must be changed so that each pack in the MPEG-PScontains only one type of data. This is because the TS packets (188bytes) that are the MPEG-TS multiplexing unit are smaller than thepackets (2 KB) that are the MPEG-PS multiplexing unit. Morespecifically, it is necessary to collect and stuff only video packetsfrom the MPEG-TS to MPEG-PS video packs (VPCK), and collect and stuffonly audio packets from the MPEG-TS to MPEG-PS audio packs (A_PCK). Asshown in FIG. 57(a), the multiplexed sequence of audio packets (Apackets) storing audio data in the MPEG-TS is changed in the convertedMPEG-PS and stored in audio pack A_PCK #1 at the end of the stream.

[0294]FIG. 57(b) describes converting a constrained format MPEG-TS to anMPEG-PS. In this constrained format eleven consecutive TS packets aremanaged as one multiplexing unit. The total amount of data stored in onemultiplexing unit is determined so as to not exceed the amount of datastored in one pack. It should be noted that the amount of data (or datasize) referred to here does not include the pack or packet headerinformation and means only the video or audio data. Furthermore, theeleven consecutive TS packets managed as one multiplexing unit all storethe same type of data, video or audio.

[0295] It will thus be obvious that by introducing multiplexing units asdescribed above it is not necessary to change the multiplexing sequenceof the TS packets that are the MPEG-TS multiplexing units whenconverting a constrained format MPEG-TS to an MPEG-PS.

[0296] As shown in FIG. 20, all TS packets stored in one multiplexingunit store only one type of elementary stream and TS packets storingdifferent types of elementary streams are not stored in a singlemultiplexing unit. It will also be noted that it may be necessary for amultiplexing unit (such as the multiplexing unit storing the last partof the stream) to also store a null packet, and mixing a null packetinto a multiplexing unit is therefore not prohibited. Including a nullpacket is also necessary to clarify the relationship betweenmultiplexing unit and packs.

[0297] One multiplexing unit thus contains 11 consecutive TS packets,and the elementary stream (payload data) in each multiplexing unit iscompletely stored to the one corresponding pack. This similarlyconstrains the pack relationship.

[0298] The TS packet storing the PES packet header is the first TSpacket in a multiplexing unit. This correlates the packet header of thepack (called the PES packet header in the MPEG-TS) to the PES packetheader in the Constrained SESF, and enables the consecutive TS packetsto be easily converted in sequence.

[0299] When the PES packets storing the video stream are divided betweenmultiple multiplexing units, all multiplexing units other than themultiplexing unit containing the last byte of the PES packet store 2024bytes (=184 ×11) of TS packet payload data. This enables the mostefficient stream transfers and makes sequential processing by TS packetunit easier during TS2PS conversions. If multiplexing units other thanthe last multiplexing unit are allowed to contain less than 2024 bytes,it will not be possible to determine the value of the PES_packet_lengthfield stored to the packet header of each MPEG-PS pack on-the-fly whenconverting the first TS packet in a multiplexing unit during TS2PSconversion.

[0300] A PES packet storing an audio stream starts at the first TSpacket in one multiplexing unit and ends within that multiplexing unit.This is easy to understand if storing a PES packet storing an audiostream to multiple multiplexing units is considered. If one audio PESpacket is divided between multiple multiplexing units, the internalstructure of the audio stream will need to be analyzed when convertingthe second and subsequent multiplexing units to MPEG-PS packs becausethe PTS must be determined or the number of audio frames in one packmust be determined in order to generate the packet header.

[0301] A multiplexing unit is thus defined as described above. Anencoder that generates a Constrained SESF performs the system-encodingwith constraints of the multiplexing unit described above.

[0302] 9.5 Constraints on the PES Packet Header in a Constrained SESF

[0303] Some constraints on the field values of the PES packet header ina Constrained SESF are described next.

[0304] As shown in FIG. 30 some PES packet header fields allow onlyfixed values. This is to prevent the need for unnecessary processingduring conversion to a DVD format. “Unnecessary processing” as used heremeans processing fields that are added or deleted by values differingfrom values defined by the DVD format. In other words, the object ofthese constraints on the PES packet header is to minimize the fieldsthat are added to or deleted from the header during TS2PS conversion.

[0305] It should be noted that the PES packet length field can be set to0 in a PES packet storing MPEG-TS video. The value stored to thePES_packet_length field must therefore be calculated during TS2PSconversion from the packet header length stored to the pack and the bytelength of the payload data.

[0306] The PTS_DTS_flags field denotes whether the PTS or DTS isdefined. The PTS_DTS flags field value in the Constrained SESF is setaccording to the following rules.

[0307] If the PES packet stores a video stream, PTS DTS_flags is set to11b under the following conditions:

[0308] 1) A frame-encoded I-picture is stored to the PES packet;

[0309] 2) A frame-encoded P-picture is stored to the PES packet;

[0310] 3) A pair of field-encoded I-pictures are stored to the PESpacket;

[0311] 4) A pair of field-encoded P-pictures are stored to the PESpacket; or

[0312] 5) A field-encoded I-picture is followed by a field-encodedP-picture in the PES packet.

[0313] If the PES packet stores an audio stream, one or more audioframes always starts in the PES packet and PTS_DTS_flags is set to 10 b(11 b if the DTS is defined).

[0314] Constraints are also applied to the PES_extension_flag andPES_header_data_length fields to enable sequential processing by TSpacket unit during TS2PS conversion. These constraints are shown in FIG.31.

[0315] As shown in FIG. 31 the field values are defined according to thetype of elementary stream, PES packet location, and encode_conditionvalue.

[0316] V1 in FIG. 31 is the sum of the byte length of the PTS field andDTS field in the PES packet. That is,

[0317] if PTS_DTS_flags=00b, V1=0;

[0318] if PTS_DTS_flags=10b, V1=4;

[0319] if PTS_DTS_flags=11b, V1=10.

[0320] This constraint is necessary to enable sequential processing byTS packet when converting to DVD-Video or DVD VR, instead of compilingthe packs after determining the payload length of each pack, as notedabove,.

[0321] The PES packet header is thus defined as described above. Anencoder that generates a Constrained SESF performs system-encoding withthe constraints described above.

[0322] 9.6 Constraints on the Tip Packet Insertion Interval

[0323] Constraints relating to the insertion interval of Tip packetsinserted to a Constrained SESF are described next.

[0324] The decoder input time denoted by the Tip packet ATS (ATS1) andthe decoder input time indicated by the ATS (ATS2) of the Tip packetstoring the video or audio stream first input to the decoder after theTip packet must be related as follows.

ATS 1+T<=ATS 2

[0325] where T is the minimum transfer time of a PS pack, This minimumtransfer time T is the shortest time from the start to the end of PSpack input to the decoder. In other words, the above equation shows thatthe ATS interval of each TS packet must be greater than the intervalenabling at least the converted PS pack to be input to the systemdecoder. T is obtained from the next formula.

T=(PS_pack_Size*8*system_clock_frequency)/PSrate

[0326] PS_pack_size is the byte length of one MPEG-PS pack generated byTS2PS conversion, system_clock_frequency is the frequency of the MPEG-PSdecoder reference clock, and PSrate is the multiplex rate of the MPEG-PSgenerated by TS2PS conversion.

[0327] PS_pack_size, system_clock_frequency, and PSrate are furtherdefined as follows by the DVD format:

[0328] PS_pack_size=2048 bytes

[0329] system_clock_frequency=27,000,000 Hz

[0330] PSrate=10,080,000 bits/second.

[0331] The relationship between ATS1 and ATS2 is therefore:

ATS 1+43885.714 . . . <=ATS 2

[0332] and ATS1+43886 =ATS2 is therefore the minimum value of ATS2.

[0333] More specifically, the TS2PS conversion described below convertsa Tip packet to a 2 KB NV_PCK (when converted to DVD-Video) or RDI_PCK(when converted to DVD VR), and if the above equation is not satisfiedtransfer of the next elementary stream starts sooner and could exceedthe DVD system transfer rate of 10.08 Mbps.

[0334] It should be noted that the same effect can be achieved byassuring the above-described interval between AV data transfers beforeand after each Tip packet, and the invention shall not be limited toinserting a period in which AV data is not transferred only after Tippacket transfer.

[0335] An integer number of GOPs are aligned between two consecutive Tippackets (that is, in one SESF capsule). This is so that data from oneTip packet to the TS packet immediately before the next Tip packet (thatis, SESF capsule) corresponds to VOBU in DVD format and the concept of aDVD format VOBU is thus also achieved in a Constrained SESF. VOBU in DVDformat (such as DVD VR) must contain an integer number of GOPs.

[0336] The time on the playback time base from one Tip packet to thenext Tip packet must be 0.4 second or longer and 1.0 second or less. Theplayback time for the playback data following the last Tip packet mustbe 0.4 sec or longer and 1.2 second or less if encode_condition=11b(DVD-Video or DVD VR mode), and 1.0 second or less ifencode_condition=01b (DVD VR mode). This is because a Tip packet meansthe start of a VOBU and to conform to each DVD format.

[0337] The access map for time-address conversion points uniquely (1:1)to each Tip packet. This is so that conversion can start immediately byVOBU unit in DVD format during TS2PS conversion.

[0338] It should be noted that it is not necessary for the access map topoint to every Tip packet. For example, the AV data following the lastTip packet in a Constrained SESF is handled differently from other Tippackets since it is different from other Tip packets, for example,different playback time, lack of following by a next Tip packet and soon, No problem with playback or conversion is thus created by notregistering the last Tip packet in the access map, and can therefore behandled as an exception with consideration for the hardwareconfiguration of the recorder. It is also possible that the access mapdoes not point to each Tip packet because of such external factors aslimitations on the size of the access map.

[0339] Constraints on the Tip packet insertion interval are thus definedas described above. An encoder that generates a Constrained SESFperforms the system-encoding within the constraints described above.

[0340] 9.7 Constraints Relating to Decoder Control

[0341] Constraints relating to Constrained SESF decoder control,specifically buffer management, are described next below.

[0342] A Constrained SESF must be generated to satisfy the standardsdefined by the standard. decoder model T_STD in MPEG-TS. This enables anSTB, for example, having a T_STD-conforming decoder to decode theConstrained SESF insofar as the stream type is compatible.

[0343] The MPEG-TS standard decoder model T_STD and the MPEG-PS standarddecoder model P_STD are substantially identical in operation andprocessing capacity, but differ in the input rate of the audio stream tothe decoder. More specifically, referring to FIG. 18, except for AAC(Advanced Audio Coding), the transfer rate to the audio buffer from thetransfer buffer before the audio decoder is a fixed 2 Mbps in the T_STD.The P_STD, however, can input each stream to the decoder at the systemrate, which with DVD is 10.08 Mbps.

[0344] This means the same buffer management cannot be used for aConstrained SESF and DVD format.

[0345] While the same buffer management thus generally cannot be usedfor a Constrained SESF and DVD format, extremely fast, simple conversioncan be achieved when converting a Constrained SESF to DVD format withoutrepeating the system encoding process if the SCR (System ClockReference) denoting the decoder input start time of the converted packscan be calculated using the ATS assigned to each TS packet. Calculationof the SCR using the ATS is described in further detail below.

[0346] A Constrained SESF according to the present invention must bepre-encoded so that it conforms to the T_STD and so that the MPEG-PSgenerated by the below-described conversion process conforms to theP_STD.

[0347] In other words, a Constrained SESF is a stream encoded to anMPEG-TS so that it also conforms to the P_STD when converted by theprocess described below to an MPEG-PS.

[0348] The constraints relating to buffer management for a ConstrainedSESF are described above. It should be noted that an SESF is simplyencoded to conform to the T_STD without being aware of the aboveconstraints.

[0349] Examples of an MPEG-TS and MPEG-PS not conforming to the T_STDand P_STD models are described below.

[0350] An MPEG-TS self-encoded to enable conversion to an MPEG-PS butnot conforming to the T_STD model is described first with reference toFIG. 32.

[0351] Stream TS1 is an MPEG transport stream that is system-encodedaccording to the T_STD model. Stream TS2 is an MPEG transport streamthat does not conform to the T_STD model.

[0352] More specifically, the values of ATS[47] to ATS[57] in stream TS2are set to exceed the allowable audio data transfer rate of an MPEG-TS.This causes the audio transport buffer (see FIG. 18) to overflow, thusnot meeting the requirements of the T_STD model. The values of ATS[47]to ATS[57] in stream TS1, however, are set to an audio data transferrate allowed in the MPEG-TS. This stream can thus be correctly convertedto an MPEG program stream PS1 conforming to the P_STD model by the SCRconversion formula described below. Stream TS2 also does not conform toT_STD but can be converted to PS1 using the SCR conversion formuladescribed below. In order to convert stream TS2 to MPEG-TS conforming toT_STD, the transfer time interval of the audio packets specified byATS[47] to ATS[57] must be spread out so that a transport bufferoverflow does not occur.

[0353] An example where the MPEG-TS conforms to the T_STD model but theMPEG-PS converted from the MPEG-TS does not conform to the P_STD modelis described next with reference to FIGS. 33A and 33B. Stream TS3 is anMPEG transport stream and steam PS3 is an MPEG program stream convertedfrom MPEG transport stream TS3. FIG. 33 (b) shows the change in thevideo data buffer state when decoding each. The PES #1 picture decodingtime is SCR [2], and PES #2 picture decoding time is between SCR [4] andSCR [5].

[0354] As shown in FIG. 33B, in transport stream TS3, data transfer ofPES #1 and PES #2 completes by a start of decoding picture data in PES#1 and PES #2. In program stream PS3, however, V_PCK #1 data istransferred successfully to the decoder for PES #1, but when decodingPES #2 V_PCK #4 data is not transferred in time and a buffer underflowoccurs because decoding began before data transfer was completed. Theprogram stream therefore does not conform to the P_STD model. To avoidthis and assure that PES #2 transfer is completed in time, the ATS (ATS[14], ATS [25], ATS [36]) of each TS packet in the MPEG-TS converted toV_PCK #2 to V_PCK #4 can be shifted to a time before PES #2 picture datais decoded.

[0355] Because buffer management preventing buffer underflow andoverflow states is thus necessary for both the encoded MPEG-TS andMPEG-PS converted therefrom, it is necessary when encoding the MPEG-TSto anticipate both the encoded MPEG-TS and the MPEG-PS convertedtherefrom.

[0356]FIGS. 58A and 58B describe buffer management for the MPEG-TS andanticipated MPEG-PS when the MPEG-TS before conversion and the MPEG-PSafter conversion have the same bit rate. Buffer management of theanticipated MPEG-PS can be assumed in the present embodiment to be thesame as buffer management for the encoded MPEG-TS. This is because thetime stamp information (calculated-PCR) set in the multiplexing units ofthe MPEG-TS converted to an MPEG-PS and the time stamp information setin the MPEG-PS packs after conversion are the same.

[0357]FIG. 58A shows an example in which a buffer underflow occurs. Datatransfer of the encoded MPEG-TS is not completed by the target time K1,that is, the DTS timing. It is therefore anticipated that data transferof the converted MPEG-PS will also not be completed in time.

[0358] To avoid this buffer underflow state the MPEG-TS time stampinformation must be set so that data transfer is completed by time K1,the DTS timing, as shown in FIG. 58B. It can thus be anticipated that abuffer underflow will also not occur with the converted MPEG-PS.

[0359]FIGS. 59A and 59B describe buffer management for the MPEG-TS andanticipated MPEG-PS when the bit rate of the MPEG-TS being converted ishigher than the resulting MPEG-PS. Buffer management of the anticipatedMPEG-PS cannot be assumed to be the same as buffer management of theencoded MPEG-TS in this case. Separate buffer management is thereforerequired for the MPEG-PS.

[0360] A buffer underflow occurs only with the MPEG-PS in the case shownin FIG. 59A. Data transfer is completed by the target time K1 (DTStiming) with the encoded MPEG-TS, and a buffer underflow does not occur.Data transfer is not completed by target time K1 (DTS timing) with theconverted MPEG-PS, however, and a buffer underflow occurs. Therefore,data transfer must also end by time K1, the DTS timing, in order toavoid a buffer underflow with the MPEG-PS. If the resulting MPEG-PS isan MPEG-PS used by the DVD standard, the system transfer rate cannot beincreased. It is therefore necessary to reduce the image rate as shownin FIG. 59B or otherwise reduce the total amount of transfer data inorder to ensure that the data can be completely transferred to thedecoder in time.

ATS-SCR Conversion

[0361] A method for determining the SCR of the PS packs when aConstrained SESF stream is converted to a program stream is describednext. It should be noted that because the SCR is calculated when newpacks are generated, the SCR must be calculated only when converting thefirst TS packet in the multiplexing unit.

[0362] The basic concept for determining the SCR is described first. Thetime stamp information (SCR) set to the packs of the MPEG-PS afterconversion is shown in FIGS. 60A and 60B for two different cases.

[0363]FIG. 60A shows a case in which the bit rate is the same in theMPEG-TS and MPEG-PS. In this case the same value as the time stampinformation (calculated_PCR) set in the corresponding multiplexing unitof the MPEG-TS is set to the time stamp information (SCR) of the MPEG-PSpacks.

[0364]FIG. 60B shows a case in which the MPEG-TS transfer rate is higherthan the MPEG-PS transfer rate. In this case the buffer input completiontime (SCR[i−1]+T) of the immediately preceding pack is set to the SCR[i]of each pack (V_PCK) in the program stream after conversion. Why the SCRis thus set is described below.

[0365] If the calculated_PCR[i] of the multiplexing unit correspondingto SCR[i] is set as in the case shown in FIG. 60A, a time earlier thanthe buffer input completion time (SCR[i−1]+T) of the immediatelypreceding pack will be set to the SCR. If the SCR is set to this timingthe stream will be unplayable by current DVD recorders, and this must beavoided. It should be noted that the MPEG-TS bit rate is set higher thanin the MPEG-PS because the maximum transfer rate is slower for audiothan for video.

[0366] Determining the SCR is described in further detail below.

[0367] In Constrained SESF stream, as shown in FIG. 55 a SESF capsuleincludes a Tip packet and a predetermined number of TS packets composingMultiplexing Unit. Since transferred in sync with a decoder referencetime STC (System Time Clock), the stream includes PCR packet to resetSTC.

[0368] As shown in FIG. 14 each TS packet is added with a first timestamp information (ATS) indicating a transferred time to the decoder. Areference time of this first time stamp information (ATS) is differentfrom the decoder reference time.

[0369] Thus, Tip packet contains second time stamp information (PCR_tip)based on the decoder reference time as well as the first time stampinformation (ATS_tip) based on the same reference time as the TS packet.By referring to Tip packet, the decoder can calculate the second timestamp information (PCR) from the first time information (ATS) of each TSpacket.

[0370] As shown in FIG. 61, the second time stamp information calculatedfrom the first time stamp information (ATS[i]) of each TS packet locatedat the head of Multiplexing unit becomes second time map information foreach Multiplexing unit (referred to as “calculated PCR[i]” below).

[0371] For example, the PCR value (PCR[i]) of a TS packet is obtainedfrom the following equation using the PCR (PCR_tip) and ATS value(ATS_tip of the first Tip packet in an SESF capsule and the ATS valueATS[i] of the next TS packet if carry (column overflow) of the ATS valueis not considered.

PCR[i]=PCR_tip+(ATS[i]−ATS_tip)

[0372] To determine calculated_PCR[1] which indicates the decoder inputtime of the first multiplexing unit in case of FIG. 61, for example, thefollowing formula can be used. $\begin{matrix}{{{calculated\_ PCR}\lbrack 1\rbrack} = {{PCR}\lbrack 2\rbrack}} \\{= {{PCR\_ tip} + {( {{{ATS}\lbrack 2\rbrack} - {ATS\_ tip}} ).}}}\end{matrix}$

[0373] The calculated_PCR for each multiplexing unit is likewisecalculated while considering ATS column overflow.

[0374]FIG. 34 shows the relationship between the calculated_PCR and SCRwhen converting from a Constrained SESF to MPEG-PS, and shows the firstpart of the capsule shown in FIG. 55. The ATS assigned in ascendingorder from the stream start to the TS packets at the beginning of eachmultiplexing unit are denoted in FIG. 34 as ATS[k]. The same notation isused for the calculated_PCR and SCR. The PCR value calculated in theorder of appearance for the first TS packet in each multiplexing unit isshown as the calculated_PCR [i] (where i=1, 2, . . . ). The SCR of theconverted packs is likewise denoted SCR [i].

[0375] As described above the maximum video stream transfer rate allowedby the T_STD model is 15 Mbps (the transfer rate from the multiplexbuffer to the video buffer cannot exceed 15 Mbps for the MP@ML, and theaudio stream input rate is limited to a rate lower than the video.(transfer rate from a transport buffer to an audio buffer does notexceed 2 Mbps except for AAC). Thus unlike a multiplexing unit storingvideo data, a multiplexing unit storing audio data is thereforetransferred at a low rate. Therefore, if the video data transfer rate isto be raised to near the 9.8 Mbps maximum transfer rate of the DVDformat, video data TS packets must be transferred at a higher rate thanthe DVD transfer rate (10.08 Mbps) in order to assure sufficienttransfer time for the audio data, which has a lower transfer rate andtherefore takes longer.

[0376] As will be known from FIG. 34, the transfer times of theConstrained SESF and DVD format differ.

[0377] The following relation must be true between the decoder arrivaltime calculated_PCR of the first TS packet in a multiplexing unit andthe SCR of the packs converted therefrom.

SCR[1]=calculated_(—) PCR[1]

SCR[i]=max(SCR[i−1] +T, calculated_(—) PCR[i])(i=2, 3, . . . )

calculated_(—) PCR[i]=PCR_tip+(ATS[i]−ATS tip+WA*BS)

T=PS_pack_size*8*system_clock_frequency/PSrate

[0378] where PCR_tip and ATS_tip are the PCR value of the Tip packetimmediately before the multiplexing unit being converted and the ATSvalue of that Tip packet; WA indicates how many times an overflowoccurred at the ATS between ATS_tip and the ATS (ATS[i]) assigned to thefirst TS packet in the i-th multiplexing unit. More specifically, theATS value is expressed as a finite bit count, there is a limit to thenumber that can be expressed, and overflow can occur. How many timessuch an overflow occurs is expressed with WA. BS is the data sizecorresponding to one ATS overflow. Function max(a,b) is a function forselecting the greater of a and b.

[0379] Furthermore, PS_pack_size in the SCR[i](i=2, 3, . . . ) relationis, as noted above, the byte length of one pack in the MPEG-PS output bythe TS2PS conversion process; system_clock_frequency is the frequency ofthe MPEG-PS decoder reference time; and PSrate is the multiplex rate ofthe MPEG-PS generated by the TS2PS conversion. More specifically,

[0380] PS pack_size=2048 bytes

[0381] system clock_frequency=27,000,000 Hz

[0382] PSrate=10,080,000 bits/second.

[0383] There are two patterns for outputting packs after the first pack:outputting the packs after waiting a minimum transfer time determined bythe transfer rate from the output time of the preceding pack, andoutputting at the decoder input time of the first TS packet in a pack.The former method of leaving the minimum transfer time before packoutput is selected when the packs are output before converting the videodata to the DVD format. For example, if the packs are output at a timebefore the video data is converted to the DVD format, the former methodof transfer after waiting a minimum transfer time determined by thetransfer rate from the output time of the preceding pack is selected.

[0384] A program stream obtained by TS2PS conversion must conform to theP_STD model as described above, and the SCR is therefore limited tovalues within a certain range. Therefore, the ATS value assigned to eachpacket of the Constrained SESF must be set with reference to the aboveATS-SCR relation.

[0385] 9.8 Constraints Relating to the Elementary Stream

[0386] Constraints relating to the elementary stream of the ConstrainedSESF are described next.

[0387] Because re-encoding the elementary streams is a very demandingprocess, only MPEG-2 Video is allowed for video data and AC-3, MPEG-1Audio, and LPCM are allowed for audio data.

[0388] The Constrained SESF omits LPCM so that re-encoding of elementarystream is not necessary and buffer management can be easier. Streamsallowed for a Constrained SESF are therefore limited to only MPEG-2Video for video data and only AC-3 and MPEG-1 Audio for audio data.

[0389] Elementary stream attributes are shown in FIG. 35 whenencode_condition=“11b”.

[0390] Because the attributes shown in the figure are set to maintaincompatibility at the elementary stream level to DVD-Video or DVD VR, aConstrained SESF (encode_condition=11b) set to these attributes does notrequire re-encoding the elementary stream for conversion to DVD-Video orDVD VR formats, and high speed conversion is therefore possible.

[0391]FIG. 36 shows elementary stream attributes whenencode_condition=“01b”.

[0392] Because the attributes shown in the figure are set to maintaincompatibility to DVD VR at the elementary stream level, a ConstrainedSESF (encode_condition=01b) which is set to these attributes does notrequire elementary stream re-encoding for conversion to DVD VR, and highspeed conversion is therefore possible.

[0393] Notes 1 to 4 in FIG. 35 and FIG. 36 are described next.

[0394] Note 1: This attribute cannot change inside the same VOB.

[0395] Note 2: This attribute can change in the TS packet storing thefirst elementary stream following the Tip packet. In other words, it canchange only in the first video or audio TS packet in the SESF capsule.

[0396] Note 3: sequence_end_code cannot be inserted betweensequence_headers where the horizontal_size, vertical_size, andaspect_ratio_information are the same.

[0397] Note 4: This attribute can change inside the same VOB.

[0398] Constraints relating to the elementary streams of a ConstrainedSESF are defined above.

[0399] It should be noted that by applying the encoding conditionsdefined above a Constrained SESF enabling fast, simple conversion to DVDformat can be produced.

[0400]FIG. 37 is a flow chart of the process for generating programstream packs from TS packets (multiplexing units) storing AV data.

[0401] As shown in the figure, a TS packet of a Constrained SESF storingAV data is converted to a 2 KB MPEG-PS pack storing AV data using onemultiplexing unit as the processing unit. This process is described stepby step below. (Step S4200) One TS packet is read from the ConstrainedSESF stream conversion starting point. (Step S4201) Whether the read TSpacket contains AV data and is the first TS packet in a multiplexingunit is determined.

[0402] Whether AV data is contained is determined by referencing the PIDvalue of the TS packet which is declared by the PMT to be storing AVdata.

[0403] If the preceding TS packet is a Tip packet, PSI/SI packet, or PCRpacket, the TS packet thereafter that contains AV data is known to bethe first TS packet in the multiplexing unit. Because the conversionstarting point is assumed to be a Tip packet, the beginning of amultiplexing unit can be detected by sequentially reading the TS packets(in other words, the first TS packet that is just after the Tip packetand contains AV data is always the beginning of a multiplexing unit).

[0404] If it is determined that the TS packet is not the beginning of amultiplexing unit, or if conversion does not start from a Tip packet andthe beginning of the multiplexing unit cannot be identified, controlreturns to step S4200 to read the next TS packet.

[0405] If the beginning of a multiplexing unit is found, controladvances to the next step.

[0406] It should be noted that while not shown in this flow chart,conversion using the above-described SCR conversion method cannot beapplied even for a TS packet at the beginning of the multiplexing unitif the Tip packet was not previously located, but conversion can proceedusing the PCR packet instead of a Tip packet.

[0407] (Step S4202) Using the ATS assigned to the first TS packet in themultiplexing unit, the decoder input time (SCR) of the MPEG-PS packconverted from that TS packet is calculated. This SCR is calculated asdescribed above. Once the SCR is determined the pack header shown inFIG. 38 is complete. This is because other than the SCR only fixedvalues are allowed in the pack header.

[0408] (Step S4203) The packet header is then generated.

[0409] The packet header is generated based on the PES packet header ofthe Constrained SESF. The resulting packet header must be formatted withthe field values shown in FIG. 39. This is because if the header lengthor other field values are not constant the conversion from a ConstrainedSESF will not be constant and buffer management will be affected. Itshould be noted that fields not shown here store constant values and aretherefore omitted here.

[0410] The field values of the PES packet header are defined in detailin the Constrained SESF to minimize the processing required forconversion from a PES packet header (MPEG-TS) to MPEG-PS packet header.

[0411] If the size of one PES packet is large relative to the size ofone pack, one PES packet is converted to multiple packs. In this case,the followings to the packet headers of the second and subsequent packsare modified: PTS_DTS_flags in the first packet header generated fromthe PES packet is set to 00 b; PES_extension_flag is set to 00 b; thestuffing_byte length is adjusted; and PES_header_data_length iscorrected.

[0412] The packet headers are thus generated by modifying partially thefirst packet header from the PES packet header, and modifying partiallythe second and later packet headers from the first packet header.

[0413] (Step S4204) The payload part of the TS packet is then simplycopied sequentially from the beginning of the payload in the PS pack.

[0414] (Steps S4205 to S4207) These steps simply repeat until themultiplexing unit is completed (i.e., for the 11 TS packets). Because anull packet could be inserted, the PID (0×1FFF) of the null packet isconfirmed and the TS packet payload data copied.

[0415] Only the TS packet storing the last data in one PES packet ispreferably defined to have an adaptation field. As a result, all TSpackets except for the TS packet storing the last data in the one PESpacket store a fixed-length payload containing 184 bytes, and readingthe payload data is thus easier.

[0416] (Step S4208) The byte length of the resulting program stream packis then calculated when copying to the end of the multiplexing unitpayload data is completed. If the pack length is 2048 bytes the pack iscompleted. If the byte length is not 2048 bytes, control steps to stepS4209.

[0417] (Step S4209) If the pack is less than 2048 bytes padding packetsare added to the end of the payload so that the pack length is 2048bytes.

[0418] Conversion from a multiplexing unit storing AV data is asdescribed above. This process simply repeats only when a multiplexingunit is detected until processing the designated part for conversion ofthe Constrained SESF ends.

[0419] The conversion process described above is described in furtherdetail below for processing the different types of packs.

Conversion to Video Packs (V_PCK)

[0420]FIGS. 40A and 40B show the conversion from a Constrained SESF toMPEG-PS. As shown in 40A, one video PES packet is normally larger than 2KB, and is therefore typically divided into multiple multiplexing unitsfor multiplexing to the Constrained SESF.

[0421] Except for the last multiplexing unit in one video PES packet,the Constrained SESF is defined so that as much PES packet data aspossible is stuffed into each multiplexing unit. Except for the lastmultiplexing unit, therefore, all multiplexing units store 2024 bytes(=184×11 bytes) of data.

[0422] By thus defining the Constrained SESF, the PES_packet_length andstuffing_byte fields can be predefined during TS2PS conversion.

[0423] The last multiplexing unit storing data for one video PES packetfills the remaining area with an adaptation field and null packets toform one complete multiplexing unit.

[0424] As shown in FIGS. 40A and 40B, the multiplexing units in onevideo PES packet include the following three types.

[0425] The first multiplexing unit storing the first data in the PESpacket (MU #1 in the figure), multiplexing units storing data from themiddle of the PES packet (MU #n where n=2, 3, . . . , N−1 in thefigure), and the multiplexing unit storing the last data from the PESpacket (MU #N).

[0426] The resulting packs of the TS2PS converted MPEG-PS are as shownin FIG. 40B according to these multiplexing unit types.

[0427] The pack converted from MU #1 is always generated with at least10 bytes of empty space, and therefore has a padding packet added to theend.

[0428] If a space of 7 bytes or less is left in a pack in the DVDformat, stuffing bytes (the last field in the packet header) are addedto a total of 2048 bytes. If 8 or more bytes are empty, a padding packetis added.

[0429] Packs converted from MU #n have one stuffing byte added tocomplete the pack. The pack converted from MU #N has a padding packetadded because at least 8 bytes are usually empty when the pack iscompiled.

Conversion to Audio Packs A_PCK

[0430]FIGS. 41A and 41B show conversion of a Constrained SESF toMPEG-PS. As shown in the figure one audio PES packet (storing one ormore audio frames) is smaller than one multiplexing unit.

[0431] Because one audio PES packet will fit into one multiplexing unit,complicated conversion such as used for video PES packet conversion isnot needed. That is, as shown in FIG. 41B, a padding packet is alwaysinserted to the generated packs.

[0432] Furthermore, because the PES packet length does not change duringTS2PS conversion, the only calculation needed for conversion is toappropriately set the stream_id during MPEG-1 Audio conversion.

[0433]FIG. 42 shows the audio bit rate allowable in a Constrained SESFand the maximum payload stored to one audio PES packet when AC-3 andMPEG-1 Audio are stored. A padding packet is always inserted becauseaudio data exceeding the maximum byte lengths shown here will not bestored to one audio PES packet.

TS2PS conversion process

[0434] The TS2PS conversion process is described in detail withreference to the flow charts in FIG. 43 to FIG. 54.

[0435]FIG. 43 is a flow chart of the main TS2PS conversion process. Thisprocess starts in response to a TS2PS conversion request from the user.The first step is to seek the first SESF capsule where conversion starts(S11). Whether the SESF capsule to process is found is then determined(S12). If it is not, the process ends. If it is found an initializationprocess (S13) and capsule unit process (S14) run.

[0436]FIG. 44 is a flow chart of the initialization process (S13). Thisprocess sets and initializes the variables used in the subsequentprocess, and starts by determining if a Tip packet was read (S21). Ifthe Tip packet has not been read, the Tip packet is read (S22). The ATSvalue of the Tip packet is then written to variable ATSTip (S23), thePCR value of the Tip packet is written to variable PCRTip (S24),variable MU_num defining the number of the multiplexing unit beingprocessed is initialized to 0 (S25), and variable WA denoting the numberof ATS overflows is initialized to 0 (S26).

[0437]FIG. 45 is a flow chart of the capsule unit process (S14). Thisprocess likewise starts by reading one TS packet (S31). Whether the readTS packet is a Tip packet is then detected (S32). If the read packet isa Tip packet, processing ends. If it is not a Tip packet, whether theread TS packet contains an audio packet or video packet is detected(S33). If the TS packet contains neither an audio packet or videopacket, control loops back to step S31, and TS packets are sequentiallyread until a TS packet containing an audio or video packet is detected(S31 to S33). If the TS packet contains an audio or video packet, thenext 10 TS packets are also read (S34). MU_num is then incremented(S35). The ATS value from the first TS packet in the multiplexing unitis then written to variable ATS[MU num] (S36). The byte length of thepayload data in the PES packet of the multiplexing unit is set topayload_len (S37). A pack unit process then runs (S38).

[0438]FIG. 46 is a flow chart of the pack unit process (S38). This packunit process consists of four subroutines: SCR calculation (S41), packheader process (S42), packet header process (S43), payload process(S44), and padding packet process (S45). Each of these subroutines isdescribed below.

[0439] The SCR calculation process is shown in FIG. 47. This processdetermines the pack SCR value.

[0440] Variable MU_num is first referenced to detect the firstmultiplexing unit in the capsule. If it is the first multiplexing unitthe value of ATSTip is written to variable ATS[0], and PCRTip is writtento variable SCR[0] (steps S51 to S53).

[0441] ATS[MU_num] and ATS[MU_num−1] are then compared (S55). The ATSvalue from the first packet in the multiplexing unit is stored toATS[i]. The ATS value denotes the relative transfer timing referenced toa given packet. The ATS value in a later packet is therefore normallyhigher than the ATS value of a preceding packet. However, because theATS is a finite value definable in 30 bits, carry (column overflow) canoccur. In this case the ATS value of a later packet could be smallerthan the ATS of a preceding packet. Step S54 monitors this reversal ofATS values and thereby determines if a carry (column overflow) occurred.If ATS[MU num] is less than or equal to ATS[MU num−1], that is, if theoverflow is detected, variable WA is incremented (S55).

[0442] The greater of SCR[MU_num−1]+T and(PCRTip+ATS[MU_num]−ATSTip+WA×BS) is then substituted for SCR[MU_num](S56).

[0443] The pack header process is described next with reference to FIG.48.

[0444] This process edits the pack header data with the data structureshown in FIG. 38. The remainder of SCR divided by 300 is written toSCR_extension (S61) and the quotient is written to SCR_base (S62),“0×6270” is written to program_mux_rate (S63), and “000 b” is written topack stuffing length (S64). Other field values are then editedappropriately to complete the pack header data (S65).

[0445] The packet header process is described with reference to FIG. 49.

[0446] This process starts with a stream ID routine to set the stream ID(S71). Whether the first TS packet in the multiplexing unit contains aPES packet header is then detected (S72). If the first TS packet in themultiplexing unit contains a PES packet header, a start-of-PES packetprocess runs (S73), and otherwise a non-start-of-PES packet process runs(S74). Whether the first TS packet in a multiplexing unit contains a PESpacket header can be determined by referencing thepayload_unit_start_indicator in the TS packet header or by directlydetecting if the PES packet header start code is stored.

[0447] The stream ID process is described next with reference to FIG.50.

[0448] This process sets the stream_ID field value. If the type ofstream being processed is “MPEG-2 Video”, the stream_id is set to “0×E0”(S81, S82). If the stream type is “AC3-Audio”, stream_id is set to“0×BD” (S83, S84). If the stream type is “MPEG-1 Audio” and “Primaryaudio”, stream_id is set to “0×C0” (S85, S86, S87). If the stream typeis “MPEG-1 Audio” and “Secondary audio”, stream_id is set to “0×C1”(S85, S88, S89).

[0449] The start-of-PES packet process is described with reference toFIG. 51.

[0450]FIG. 56 shows the PES packet structure of the MPEG standard indetail. This start-of-PES packet process edits the field valuesaccording to the structure shown in FIG. 56.

[0451] If the stream type is “MPEG-2 Video” is detected first (S91). Ifit is, the value calculated from the following equation is written toPES_packet_length (S92).

[0452] PES_packet_length=(3+PES_header_data_length)+payload_len

[0453] The 3 bytes from “10” to PES_header_data_length (see FIG. 56) ineach field of the TS packet before conversion are copied directly to thecorresponding field of the packet header of the converted MPEG-PS pack(S93). PTS_DTS_flags in the TS packet before conversion is referenced todetect if a PTS is present (S94). If a PTS is present, it is copieddirectly to the corresponding field of the packet header in theconverted MPEG-PS pack (S95). PTS_DTS_flags is likewise referenced todetect if a DTS is present (S96). If a DTS is present, it is copieddirectly to the corresponding field of the packet header in theconverted MPEG-PS pack (S97). If the PES_extension_flag is set to “1”(S98), step S99 runs.

[0454] In step S99 the stream type is again detected, and the threebytes from PES_private_data_flag to P_STD_buffer_flag are overwrittenaccording to the detected stream type. That is, if the stream type is“MPEG-2 Video” (S99), the three bytes from PES_private_data_flag toP_STD_buffer_flag are overwritten with “0×1E60E8” (S100). If the streamtype is “AC3-Audio” (S101), “0×1E603A” is written (S102). If the streamtype is “MPEG-1 Audio” (S103), “0×1E4020” is written (S104).

[0455] The non-start-of-PES packet process is described next withreference to FIG. 52.

[0456] The 2 bytes from “10” to PES_extension flag in the PES packet areset to “0×8000” (S11), and whether the payload_len is less than 2018 isdetected (S112). The payload_len is the data length of the PES packet inone multiplexing unit and is a maximum 184×11=2024 bytes. If payload_lenis less than 2018, PES_header_data_length is set to 0 (S113). Ifpayload_len is greater than or equal to 2018, PES_header_data_length isset to (2025—payload _len) (S114) and the PES packet is stuffed the bytelength of PES_header_data_length (S115). The value calculated from thefollowing equation is set to PES_packet_length (S116).

[0457] PES_packet_length=(3+PES_header_data_length)+payload_len

[0458] The payload process is described next with reference to FIG. 53.

[0459] Variable i is first initialized to 1 (S121). The payload data ofthe PES packet stored to the i-th TS packet is then read (122) and addedto the payload data of the pack (S123). Variable i is then incremented(S124). Steps S122 to S125 repeat until i=12 (S125), that is, until allTS packets in one multiplexing unit are processed.

[0460] The padding packet process is described next with reference toFIG. 54.

[0461] Whether PES_packet_length equals 2028 is first detected (S131).If PES_packet_length does not equal 2028, PES_packet_length of thepadding packet is set to {(2028—PES_packet_length)−6} (S132), and thepadding packet is added to the payload (S133).

[0462] Although the present invention has been described in connectionwith the preferred embodiments thereof with reference to theaccompanying drawings, it is to be noted that various changes andmodifications will be apparent to those skilled in the art. Such changesand modifications are to be understood as included within the scope ofthe present invention as defined by the appended claims, unless theydepart therefrom.

1. A stream conversion apparatus for converting a first stream ofmultiplexed video data and audio data recorded to a recording medium toa second stream, the first stream having a structure for storing datasegmented in first blocks, the second stream having a structure forstoring data segmented in second blocks, the maximum data size of thefirst and second blocks being different, wherein the first stream formatis a constrained format for conversion to the second stream, with theconstrained format, a specific number of consecutive first blocks in thefirst stream are managed as a unit (Multiplexing Unit), the specificnumber is set so that a total amount of data stored in the unit does notexceed an amount of data stored to one second block, and all data storedin the same unit are the same video stream or the same audio stream, aninput start time to a system decoder of a destination second block towhich the stream is converted is the same as the later one of a firstcandidate time and a second candidate time, the first candidate timebeing the input start time to the system decoder of a source unit beingconverted, the second candidate time being the time at which input tothe system decoder of the second block immediately before thedestination second block to which the source unit is converted ends, therecording medium also records a flag indicating whether the recordedfirst stream is recorded in the constrained format, the streamconversion system comprises: a reading section operable to read thefirst stream from the recording medium; a conversion section operable toconvert the read first stream to a second stream; and a recordingsection operable to record the converted second stream to the recordingmedium; and the conversion section references the flag to determine ifthe format of the first stream is the constrained format, and when thefirst stream determined to be recorded using the constrained format,converts, by unit, the first blocks composing the unit to one secondblock without changing the multiplexing order of the first blocks, andselects the later one of the first and second candidate times as thetime stamp information of the converted second block to set the decoderinput start time of the second block.
 2. The stream conversion apparatusaccording to claim 1, wherein: a plurality of consecutive units in thefirst stream are managed as a capsule in which a control block isinserted; the first block located at the head of the unit includes firsttime stamp information (ATS[i]) indicating an input start time to asystem decoder based on a first reference value; the control blockcontains the first time stamp information (ATS_tip) based on the firstreference value, and second time stamp information (PCR_tip) based on asecond reference value different from the first reference value; and thesecond time stamp information (calculated_PCR[i]) of the first blocklocated at the head of each unit and input start time (SCR[i]) to thesystem decoder of each second block included in the second streamconverted from the first stream are obtained from the followingformulas, SCR[1]=calculated_(—) PCR[1]SCR[i]=max(SCR[i−1]+T,calculated_(—) PCR[i])calculated_(—) PCR[i]=PCR_tip +(ATS[i]−ATS_tip+C)where i is an integer which is 2 or more, T is the minimum transfer timeof a second block, and C is a correction factor for overflow of ATS[i].3. The stream conversion apparatus according to claim 1, wherein whendetermining, by referencing the flag, that the format of the firststream is not the constrained format, the conversion section re-encodesthe first stream to convert the first stream to the second stream.
 4. Arecording apparatus for multiplexing video information and audioinformation to record the information to a recording medium in a formatenabling conversion from a first stream to a second stream, the firststream having a structure for storing data segmented in first blocks,the second stream having a structure for storing data segmented insecond blocks, the maximum data size of the first and second blocksbeing different, wherein with the format, a specific number ofconsecutive first blocks in the first stream are managed as a unit(Multiplexing Unit), the specific number is set so that a total amountof data stored in the unit does not exceed an amount of data stored toone second block, and all data stored in the same unit are the samevideo stream or the same audio stream, a plurality of consecutive unitsincluding video data by decode unit in the first stream are managed as acapsule in which a control block is inserted, the control block stores aflag indicating if the recording format of the first stream is theconstrained format, an input start time to a system decoder of adestination second block to which the stream is converted is the same asthe later one of a first candidate time and a second candidate time, thefirst candidate time being the input start time to the system decoder ofa source unit being converted, and the second candidate time being thetime at which input to the system decoder of the second blockimmediately before the destination second block to which the source unitis converted ends, the first stream is converted to the second stream byconverting, by unit, the first blocks composing the unit to one secondblock without changing the multiplexing order of the first blocks, andselecting the later one of the first and second candidate times as thetime stamp information of the converted second block to set the decoderinput start time of the second block; the recording apparatus comprises:an encoding section operable to encode the video information and audioinformation to be recorded to the first stream according to the format;a recording section operable to record the encoded first stream to therecording medium; and a control section operable to control the encodingsection and recording section, the control section anticipates thesecond stream converted from the encoded first stream when encoding thefirst stream, and then encodes the first stream so that at least one ofa buffer underflow and buffer overflow occurs in neither the encodedfirst stream or the anticipated second stream.
 5. The recordingapparatus according to claim 4, wherein: a plurality of consecutiveunits in the first stream are managed as a capsule in which a controlblock is inserted; the first block located at the head of the unitincludes first time stamp information (ATS[i]) indicating an input starttime to a system decoder based on a first reference value; the controlblock contains the first time stamp information (ATS_tip) based on thefirst reference value, and second time stamp information (PCR_tip) basedon a second reference value different from the first reference value;and the second time stamp information (calculated_PCR[i]) of the firstblock located at the head of each unit and input start time (SCR[i]) tothe system decoder of each second block included in the second streamconverted from the first stream are obtained from the followingformulas, SCR[1]=calculated_(—) PCR[1]SCR[i]=max(SCR[i−1]+T,calculated_(—) PCR[i])calculated_(—) PCR[i]=PCR_tip +(ATS[i]−ATS_tip+C)where i is an integer which is 2 or more, T is the minimum transfer timeof a second block, and C is a correction factor for overflow of ATS[i].6. A recording medium for recording video data and audio datamultiplexed in a format enabling converting a first stream to a secondstream, the first stream having a structure for storing data segmentedin first blocks, the second stream having a structure for storing datasegmented in second blocks, the maximum data size of the first andsecond blocks being different, wherein with the format, a specificnumber of consecutive first blocks in the first stream are managed as aunit (Multiplexing Unit), the specific number is set so that a totalamount of data stored in the unit does not exceed an amount of datastored to one second block, and all data stored in the same unit are thesame video stream or the same audio stream, a plurality of consecutiveunits including video data by decode unit in the first stream aremanaged as a capsule in which a control block is inserted, the controlblock stores a flag indicating if the recording format of the firststream is the constrained format, an input start time to a systemdecoder of a destination second block to which the stream is convertedis the same as the later one of a first candidate time and a secondcandidate time, the first candidate time being the input start time to asystem decoder of a source unit being converted, and the secondcandidate time being the time at which input to the system decoder ofthe second block immediately before the destination second block towhich the source unit is converted ends, the first stream is convertedto the second stream by converting, by unit, the first blocks composingthe unit to one second block without changing the multiplexing order ofthe first blocks, and selecting the later one of the first and secondcandidate times as the time stamp information of the converted secondblock to set the decoder input start time of the second block.
 7. Astream conversion method for converting a first stream of multiplexedvideo data and audio data recorded to a recording medium to a secondstream, the first stream having a structure for storing data segmentedin first blocks, the second stream having a structure for storing datasegmented in second blocks, the maximum data size of the first andsecond blocks being different, wherein the first stream format is aconstrained format for conversion to the second stream, with theconstrained format, a specific number of consecutive first blocks in thefirst stream are managed as a unit (Multiplexing Unit), the specificnumber is set so that a total amount of data stored in the multiplexingunit does not exceed an amount of data stored to one second block, andall data stored in the same unit are the same video stream or the sameaudio stream, an input start time to a system decoder of a destinationsecond block to which the stream is converted is the same as the laterone of a first candidate time and a second candidate time, the firstcandidate time being the input start time to the system decoder of asource unit being converted, the second candidate time being the time atwhich input to the system decoder of the second block immediately beforethe destination second block to which the source unit is converted ends,the recording medium also records a flag indicating whether the recordedfirst stream is recorded in the constrained format, the streamconversion method comprises referencing the flag to determine the formatof the first stream in order to convert the first stream to the secondstream, when the format of the first stream is the constrained format,converting, by unit, the first blocks composing the unit to one secondblock without changing the multiplexing order of the first blocks, andselecting the later one of the first and second candidate times as thetime stamp information of the converted second block to set the decoderinput start time of the second block.
 8. A recording method formultiplexing video information and audio information to record theinformation to a recording medium in a format enabling conversion from afirst stream to a second stream, the first stream having a structure forstoring data segmented in first blocks, the second stream having astructure for storing data segmented in second blocks, the maximum datasize of the first and second blocks being different, wherein with theformat, a specific number of consecutive first blocks in the firststream are managed as a unit (Multiplexing Unit), the specific number isset so that a total amount of data stored in the unit does not exceed anamount of data stored to one second block, and all data stored in thesame unit are the same video stream or the same audio stream, aplurality of consecutive units including video data by decode unit inthe first stream are managed as a capsule in which a control block isinserted, the control block stores a flag indicating if the recordingformat of the first stream is the constrained format, an input starttime to a system decoder of a destination second block to which thestream is converted is the same as the later one of a first candidatetime and a second candidate time, the first candidate time being theinput start time to the system decoder of the source unit beingconverted, and the second candidate time being the time at which inputto the system decoder of the second block immediately before thedestination second block to which the source unit is converted ends, thefirst stream is converted to the second stream by converting, by unit,the first blocks composing the unit to one second block without changingthe multiplexing order of the first blocks, and selecting the later oneof the first and second candidate times as the time stamp information ofthe converted second block to set the decoder input start time of thesecond block, the recording method comprises, when encoding the firststream, anticipating the second stream converted from the encoded firststream, and encoding the first stream so that at least one of bufferunderflow or buffer overflow occurs in neither the encoded first streamor the anticipated second stream.
 9. A computer-readable program forexecuting the method as described in claim 7 or claim 8 on a computer.